Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/2a7596d745cbcf6cd52587cfd4e594ef to your computer and use it in GitHub Desktop.
Save KaineLabs/2a7596d745cbcf6cd52587cfd4e594ef to your computer and use it in GitHub Desktop.
Allow Custom Tab For Profile Owners Only.
<?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