Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Limit Profile Tab By Member Type.
<?php
/**
* Limit Profile Tab By Member Type.
*/
function yzc_limit_profile_tab_by_member_type() {
// Get User Member Type
$member_type = bp_get_member_type( bp_displayed_user_id() );
// Remove Tabs By Member Type
if ( 'member_type_id_here1' != $member_type ) {
bp_core_remove_nav_item( 'tab_slug_here1' );
} else if ( 'member_type_id_here2' != $member_type ) {
bp_core_remove_nav_item( 'tab_slug_here2' );
}
}
add_action( 'bp_actions', 'yzc_limit_profile_tab_by_member_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment