Tagged: code, tab-remove
Hi,
is it possible to remove activity tab (or others) for member types on members page?I’ve seen it is working for add friend button in this post https://buddydev.com/support/forums/topic/remove-add-friend-button-for-member-type-on-members-pagemembers-loop/#post-8565
Thanks for help.
Hi,
I am sorry, I missed your post on forum.1. Do you mean the profile activity tab? Yes, it is but it qill most probably break the site if you don’t set some other component as the default component.
Please let me know your goals and I will be able to assist.
Thank you
BrajeshHi Behos,
Please use the following example./** * Hide User activity tab for displayed user. * * Unless you have default component set to something else, this is not recommended. */ function buddydev_hide_displayed_user_activity_tabs() { if ( ! bp_is_user() ) { return ; } // want to do it based on role? use capability and do it. if ( ! user_can( bp_displayed_user_id(), 'manage_options' ) ) { bp_core_remove_nav_item( 'activity' ); } // want to do it based on member types? un comment the following block and modify /* if ( bp_has_member_type( bp_displayed_user_id(), 'some_member_type' ) ) { bp_core_remove_nav_item( 'activity' ); }*/ } add_action( 'bp_setup_nav', 'buddydev_hide_displayed_user_activity_tabs', 11 );
Please feel free to adapt to your use case.
hope that helps.
Regards
Brajesh
The topic ‘ [Resolved] Remove activity tab for specific member type on members page/members loop’ is closed to new replies.