• Resolved douvan

    (@douvan)


    I’d like to be able to disable premium banks. I added this code to functions.php.

    However it doesn’t seem to work. Syntax error?

    function stockpack_providers( $providers ) {
    return [
    ‘Pexels’ => __( ‘Pexels’, ‘stockpack’ ),
    ‘Pixabay’ => __( ‘Pixabay’, ‘stockpack’ ),
    ‘Unsplash’ => __( ‘Unsplash’, ‘stockpack’ ),
    ];
    }

    add_filter( ‘stockpack_providers’, ‘stockpack_providers’, 20, 1 );

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor ionut.calara

    (@ionutcalara)

    Hi @douvan the code looks correct, so it should work. This updates a list of values in javascript, so it might be cache in the browser. Try to clear the browser cache and see if that works.

    Thread Starter douvan

    (@douvan)

    Hi @ionutcalara,

    There is an error on the line where “return” begins.

    https://paste.pics/886f8b8b99a5f98f66e8e82355f1fbe7

    See screenshot of code editor.

    Plugin Contributor ionut.calara

    (@ionutcalara)

    Hi @douvan the only error might be related to an older version of PHP.

    Try this instead:

    
    function stockpack_providers( $providers ) {
    return array(
    "Pexels" => __( "Pexels", "stockpack" ),
    "Pixabay" => __( "Pixabay", "stockpack" ),
    "Unsplash" => __( "Unsplash", "stockpack" ),
    );
    }
    
    add_filter( ‘stockpack_providers’, ‘stockpack_providers’, 20, 1 );
    
    Plugin Contributor ionut.calara

    (@ionutcalara)

    Hi there, I am closing this issue for now, but feel free to reopen.

    I would love to see an update where you put providers checkboxes that the user can just select from the settings screen and then only those show up in the media area.

    I tried the code above and it is not working for me.

    Plugin Contributor ionut.calara

    (@ionutcalara)

    Hi @kcwebguy, I might add that at some point, for now can you try to clear the cache in the browser, or try with a different browser?

    I have cleared the cache and tried different browsers. All with no luck.

    I am happy to have you take a look if you want to. Please let me know how to contact you with my private information.

    Plugin Contributor ionut.calara

    (@ionutcalara)

    Hi @kcwebguy there’s a support ballon on the bottom right here: https://stockpack.co/contact

    Got it! Will submit my info there for you.

    Thanks!

    Plugin Contributor ionut.calara

    (@ionutcalara)

    The issue was related to quotes, here’s the function with the proper quotes.

    function stockpack_providers( $providers ) {
      return array(
        'Pexels' => __( 'Pexels', 'stockpack' ),
        'Pixabay' => __( 'Pixabay', 'stockpack' ),
        'Unsplash' => __( 'Unsplash','stockpack' ),
      );
    }
    
    add_filter( 'stockpack_providers', 'stockpack_providers', 20, 1 );
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Disable Premium’ is closed to new replies.