Skip to:
Content
Pages
Categories
Search
Top
Bottom

Nav Menu Item Missing on Other usre Profile


  • shameem5566
    Participant

    @shameem5566

    I have to hide some nav menus of bp users’ profile page from other users. I using the following function to do so. That was working fine.

    /* BuddyPress profile nav menu restrictions */

    function bpex_hide_profile_menu_tabs()
    {

    if (bp_is_active(‘xprofile’)) :

    if (bp_is_user() && !bp_is_my_profile()) {
    // BP’s profile main menu items. Comment those to show.
    // bp_core_remove_nav_item( ‘activity’ );
    // bp_core_remove_nav_item(‘profile’);
    bp_core_remove_nav_item(‘friends’);
    bp_core_remove_nav_item(‘groups’);
    // exist only if you use bbPress
    bp_core_remove_nav_item(‘forums’);
    // bp_core_remove_nav_item(‘activity’);
    bp_core_remove_nav_item(‘following’);
    bp_core_remove_nav_item(‘followers’);
    bp_core_remove_nav_item(‘bookmarks’);
    bp_core_remove_nav_item(‘activity’);

    // BP’s profile main menu items. Comment those to show.
    bp_core_remove_subnav_item(‘activity’, ‘personal’);
    bp_core_remove_subnav_item(‘activity’, ‘friends’);
    bp_core_remove_subnav_item(‘activity’, ‘groups’);
    bp_core_remove_subnav_item(‘activity’, ‘following’);
    bp_core_remove_subnav_item(‘activity’, ‘feed’);
    }
    bp_core_remove_subnav_item(‘activity’, ‘mentions’);
    bp_core_remove_subnav_item(‘activity’, ‘favorites’);

    endif;
    }
    add_action(‘bp_init’, ‘bpex_hide_profile_menu_tabs’, 15);

    I have this navigation menu for the bp user on the header by default. When I am viewing other’s profiles the nav menus inside the user’s header menu also get hidden.

    Is there any other ways to do this.

    I am using the latest version of WordPress 5.4.2, BuddyPress 6.0.0, and BuddyX Theme 1.3.7.

  • You must be logged in to reply to this topic.
Skip to toolbar