Created
April 30, 2019 05:39
-
-
Save KaineLabs/ecaa2532c740d9602c8e7805a116da9f to your computer and use it in GitHub Desktop.
Limit Profile Tab By Member Type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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