[Resolved] Remove add friend button for member type on members page/members loop
-
Hi, I want to remove the ‘add friend’ button for a specific member type in my buddypress site on the members page. I don’t want them to have friend requests from anyone.
I tried this code provided by @henrywright but it only works for the individual members page and not the members loop. After applying the code to bp-custom.php file the add friend button still shows on the member’s page.
The idea is that I have a member type called business and it would not make sense to add a business as a friend but you can only follow a business.
function browserco_filter_add_friend_button( $button ) { $member_type = bp_get_member_type( bp_displayed_user_id() ); if ( 'business' !== $member_type ) { return $button; } return ''; } add_filter( 'bp_get_add_friend_button', 'browserco_filter_add_friend_button' );
Please can anyone help with this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Resolved] Remove add friend button for member type on members page/members loop’ is closed to new replies.