Posted on

How to Hide BuddyPress Job Manager Tabs & Nav Bar Links

How to remove BuddyPress navigation tabs depending upon the user roles.


function bp_remove_nav_tabs() {

if (current_user_can('special_role'))
{
   bp_core_remove_nav_item( 'job-manager' ); // to remove job manager tab section totally
   bp_core_remove_subnav_item( 'job-manager', 'jobs' ); // remove only jobs tabs

   bp_core_remove_nav_item( 'resume-manager' ); // to remove resume manager tab section totally
   bp_core_remove_subnav_item( 'job-manager', 'resumes' ); // remove only resume tabs
}

}
add_action( 'bp_setup_nav', 'bp_remove_nav_tabs', 999 );

How to remove BuddyPress admin navigation tabs depending upon the user roles.


function my_remove_activity_menu() {

  if (current_user_can(‘special_role’)) {
    global $wp_admin_bar;

    // $wp_admin_bar->remove_menu(‘my-account-job-manager’); // to remove job manager nav section totally
    $wp_admin_bar->remove_menu(‘my-account-job-manager-jobs’); // remove only jobs admin bar menu.

    // $wp_admin_bar->remove_menu(‘my-account-resume-manager’); // to remove resume manager nav section totally
    $wp_admin_bar->remove_menu(‘my-account-resume-manager-resumes’); // remove only resumes admin bar menu.
  }

}
add_action(‘bp_setup_admin_bar’, ‘my_remove_activity_menu’,301);

Leave a Reply

Your email address will not be published. Required fields are marked *