Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created March 12, 2019 19:47
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/15ec2178d6d1b67c4210b17fd3f8563e to your computer and use it in GitHub Desktop.
Save KaineLabs/15ec2178d6d1b67c4210b17fd3f8563e to your computer and use it in GitHub Desktop.
Only Profile owners & Admins Can See All The Wall Subnavs
<?php
/**
* Only Profile owners & Admins Can See All The Wall Subnavs.
*/
function yzc_remove_wall_subnavs() {
if ( ! bp_is_active( 'activity' ) || bp_current_user_can( 'delete_users' ) || bp_is_my_profile() || ! bp_is_user_activity() ) {
return;
}
// Get Forbidden Subtab.
$forbidden_subtabs = array( 'mentions', 'following', 'groups', 'favorites', 'friends' );
foreach ( $forbidden_subtabs as $tab ) {
bp_core_remove_subnav_item( bp_get_activity_slug(), $tab );
}
}
add_action( 'bp_init', 'yzc_remove_wall_subnavs', 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment