Created
January 17, 2019 23:43
-
-
Save KaineLabs/2a7596d745cbcf6cd52587cfd4e594ef to your computer and use it in GitHub Desktop.
Allow Custom Tab For Profile Owners Only.
This file contains 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 | |
/** | |
* Allow Custom Tab For Profile Owners Only. | |
*/ | |
function yzc_allow_custom_tab_for_profile_owners_only() { | |
if ( ! bp_is_my_profile() ) { | |
// Put Here The Custom Tab Slug. | |
$custom_tab_slug = 'submit-post'; | |
bp_core_remove_nav_item( $custom_tab_slug ); | |
} | |
} | |
add_action( 'bp_actions', 'yzc_allow_custom_tab_for_profile_owners_only', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment