WPIntell

Source evidence

Admin only share

BP Activity Share · support · 2017-04-19T14:24:00+00:00

complaintsentiment
mediumseverity
0.86relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

2 / 30 rows with source links

6.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
nakes unresolved
Hi, Is there a way to set user capabilities with this plugin? I want the share option only available to Admin users. 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. 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 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) ); } } 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 Hi @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.

Comments

5 shown
nakes 2017-04-20T14:16:00+00:00

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.

nakes 2017-04-25T11:59:00+00:00

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

nakes 2017-04-26T12:58:00+00:00

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) ); } }

nakes 2017-05-02T08:41:00+00:00

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

Sanket Parmar 2017-07-22T16:42:00+00:00

Hi @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.