Title: Admin only share
Last modified: April 19, 2017

---

# Admin only share

 *  [nakes](https://wordpress.org/support/users/nakes/)
 * (@nakes)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/admin-only-share/)
 * Hi,
 * Is there a way to set user capabilities with this plugin? I want the share option
   only available to Admin users.

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

 *  Thread Starter [nakes](https://wordpress.org/support/users/nakes/)
 * (@nakes)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/admin-only-share/#post-9049316)
 * Perhaps there’s a way to integrate this with the capabilities manager plugin?
   Then the role permissions for this plugin could be controlled via the capabilities
   manager plugin.
 *  Thread Starter [nakes](https://wordpress.org/support/users/nakes/)
 * (@nakes)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/admin-only-share/#post-9065237)
 * Another thought, instead of hooking into the capabilities manager plugin, can
   we add a function to the functions.php file of a child template to hide or disable
   this plugin for all user roles except Admin.
 * I assume that way the share option won’t show to user’s who don’t have an Admin
   user role.
 * perhaps something like this:
    [https://wordpress.stackexchange.com/questions/246704/disable-plugins-for-a-specific-user-role](https://wordpress.stackexchange.com/questions/246704/disable-plugins-for-a-specific-user-role)
 *  Thread Starter [nakes](https://wordpress.org/support/users/nakes/)
 * (@nakes)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/admin-only-share/#post-9069939)
 * If this helps anyone else looking for this, I used the code below:
 *     ```
           /**disable the BP Activity share for all except admin**/
           add_action('admin_init', 'my_filter_the_plugins');    
           function my_filter_the_plugins()
           {
               global $current_user;
           if ( in_array('participant', $current_user->roles) || in_array('subscriber', 
           $current_user->roles) ) {
                   deactivate_plugins( // deactivate for participant and subscriber
                       array(
                           '/bp-activity-share/bp-activity-share.php'
                       ),
                       true // silent mode (no activation hooks fired)
                  );
               } else { // activate for those than can use it
                   activate_plugins(
                       array(
                           '/bp-activity-share/bp-activity-share.php'
                       ),
                       '', // redirect url, does not matter (default is '')
                       false // network wide)
                   );
               }
           }
       ```
   
 *  Thread Starter [nakes](https://wordpress.org/support/users/nakes/)
 * (@nakes)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/admin-only-share/#post-9087867)
 * The above ‘Solution’ doesn’t seem to work as expected. It seemed to work on my
   test site but didn’t work on the live site for some reason.
 * It would be great to get some input/feedback from the developers of this module.
 * Thanks
 *  Plugin Author [Sanket Parmar](https://wordpress.org/support/users/sanketparmar/)
 * (@sanketparmar)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/admin-only-share/#post-9342887)
 * Hi [@nakes](https://wordpress.org/support/users/nakes/),
 * Sorry for the delayed follow-up. I hope you are doing great. 🙂
 * We’ll definitely try to find the proper solution to your query and get back to
   you.

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

 The topic ‘Admin only share’ is closed to new replies.

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

 * 6 replies
 * 2 participants
 * Last reply from: [Sanket Parmar](https://wordpress.org/support/users/sanketparmar/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/admin-only-share/#post-9342887)
 * Status: not resolved