Role access and stop ‘request access’ button
-
Hello,
I have the below snippet working to stop displaying the ‘request access’ button to the WP role ‘y_member’.
How do I also make it so that those with the role ‘e_member’ also do not see the ‘request access’ button? I would also like it that if a user is already a member of the group that they can access the group – as this seems to stop users accessing the group.
I have tried:
if ( in_array( 'y_member' || 'e_member', (array) $current_user->roles )) {
This did not work.// Remove Join/Leave Button function bp_remove_group_join_button( $button, $group ) { $current_user = wp_get_current_user(); if ( in_array( 'y_member', (array) $current_user->roles )) { return ''; } return $button; } add_filter( 'bp_get_group_join_button', 'bp_remove_group_join_button', 10, 2);
Thanks for the help
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.