Title: Hide the gallery from specific users (BuddyPress profile)
Last modified: August 31, 2016

---

# Hide the gallery from specific users (BuddyPress profile)

 *  Resolved [rothaar](https://wordpress.org/support/users/rothaar/)
 * (@rothaar)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/)
 * Hi
    thank you for this plugin. 🙂
 * Is it possible to hide the gallery in the profile of specific users? I’m not 
   a programmer so go easy on me here. 🙂
 * I would like only one group of users to be able to create galleries. The other
   group should be able to view the galleries (based on the privacy settings of 
   course), but I would like to hide the Gallery from their BuddyPress profile menu
   so they are not able to create a gallery.
 * Thank you for your help.
 * [https://wordpress.org/plugins/mediapress/](https://wordpress.org/plugins/mediapress/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * (@sbrajesh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022704)
 * Hi,
    Thank you for asking.
 * Currently, It is easily possible to disallow a user to create gallery using the
   filter as shown below.
 *     ```
       //stop gallery creation, only superadmin can
       function mpp_custom_check_gallery_create_permission( $can_do, $component,  $user_id ) {
   
       	if ( is_super_admin() ) {
       		$can_do = true; //ok super admin can create it
       	} else {
       		$can_do = false;//no one else can
       	}
   
       	return $can_do;
       }
   
       add_filter( 'mpp_user_can_create_gallery', 'mpp_custom_check_gallery_create_permission', 10, 3 );
       ```
   
 * Instead of is_super_admin you can use current_user_can to check for specific 
   ability.
 * Currently, it won’t hide the gallery tab but will not allow creating.
    In next
   2-3 days, I will be pushing another update, that will allow you to hide the gallery
   tabs too.
 * Thank you
    Brajesh
 *  Thread Starter [rothaar](https://wordpress.org/support/users/rothaar/)
 * (@rothaar)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022726)
 * Hi Brajesh,
 * thank you for your quick reply! That would be great if this could be done via
   the admins panel! Thank you! 🙂
 * As I said I’m not a programmer so I just want to make sure that I understand 
   the code right. I’ve created a user role that is called teacher, which is the
   one that I want to be able to see the the gallery tab and also create galleries.
   So I just need to replace is_super_admin with is_teacher and put the code in 
   bp-custom.php, right? Would the super-admin or the admin still have access?
 * Thank you again!
    K.
 *  Plugin Author [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * (@sbrajesh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022740)
 * Hi K,
    No problem. Sorry about the above. I will rather put the options in admin
   panel. No, Please do not put the code by modifying. There does not exists any
   function name like is_teacher.
 * In WordPress it is not recommended to do checks based on roles, instead the capability
   is considered the right thing to check.
 * What are the capability differences between teacher and students?
    Here is the
   codex page to understand capability. [https://codex.wordpress.org/Roles_and_Capabilities](https://codex.wordpress.org/Roles_and_Capabilities)
 *  Plugin Author [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * (@sbrajesh)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022899)
 * Hi K,
    I have added better support for disabling MediaPress for specific users/
   user groups.
 * Can you please tell me if there is a way to differentiate between your roles 
   or how you created the roles. I can provide some ready to use code then.
 * Thank you
    Brajesh
 *  Plugin Author [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * (@sbrajesh)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022930)
 * Hi K,
    Hope you are doing well.
 * If you have time, please do let me know if I can be helpful in anyway.
    You may
   also want to take a look at this post to see how to disable MediaPress for specific
   roles. [http://buddydev.com/mediapress-development/mediapress-1-0-1-is-available-now/](http://buddydev.com/mediapress-development/mediapress-1-0-1-is-available-now/)
 * Thank you
    Brajesh
 *  Plugin Author [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * (@sbrajesh)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022941)
 * Hi,
    I am marking it as resolved due to lack of activity. Please feel free to
   reopen it or create a new topic if you need any assistance.
 * Thank you
    Brajesh

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Hide the gallery from specific users (BuddyPress profile)’ is closed 
to new replies.

 * ![](https://ps.w.org/mediapress/assets/icon-256x256.png?rev=1566617)
 * [MediaPress](https://wordpress.org/plugins/mediapress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mediapress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mediapress/)
 * [Active Topics](https://wordpress.org/support/plugin/mediapress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mediapress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mediapress/reviews/)

## Tags

 * [buddypress profile](https://wordpress.org/support/topic-tag/buddypress-profile/)

 * 6 replies
 * 2 participants
 * Last reply from: [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/hide-create-gallery-from-specific-users/#post-7022941)
 * Status: resolved