Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/ecaa2532c740d9602c8e7805a116da9f to your computer and use it in GitHub Desktop.
Save KaineLabs/ecaa2532c740d9602c8e7805a116da9f to your computer and use it in GitHub Desktop.
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