Support » Plugin: Best WordPress Gallery Plugin – FooGallery » Hide specific gallery

  • Resolved imstanleyyeo

    (@imstanleyyeo)


    Hi @bradvin,

    Would you be able to provide some guidance to hiding a specific gallery in the backend ‘Galleries – click a gallery to add it to your album’ metabox? Meaning the gallery thumbnail pile will not appear to some users.

    Thanks again for this wonderful plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bradvin

    (@bradvin)

    hey @imstanleyyeo,

    I had a look at the code, and there is no way to do this currently.
    The best way to do this would be by providing a filter, that you can override in your functions.php. Adding a simple filter to accomplish this would be pretty straight forward.

    I have pushed this change to the develop branch in github for you to test: https://github.com/fooplugins/foogallery/tree/develop

    It will be released in the next update.

    Then you can add this code to your functions.php to specifically exclude galleries:

    
    function foogallery_exclude_specific_galleries( $excluded, $album ) {
        $excluded[] = 342; //Change this to the ID you want to exclude
    
        return $excluded;
    }
    
    add_filter( 'foogallery_album_exlcuded_galleries', 'foogallery_exclude_specific_galleries', 10, 2 );
    
    Thread Starter imstanleyyeo

    (@imstanleyyeo)

    Thanks for the prompt response, appreciate it @bradvin!

    +1. This is very much needed so that users will not be able to mess up with the galleries. (:

    Just check if this piece of code is set to work with the develop branch repo?

    Looking forward to the next update of this plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide specific gallery’ is closed to new replies.