Activity

  • Khelil replied to the topic Reorder, Rename and Regroup Menu Nav item in the forum BuddyBoss 3.0 10 years, 3 months ago

    Hello Guy’z,

    Thank you both for your messages.

    @tjchester it’s a pleasure to be here !

    @successful thanks for sharing, but i was looking for a hand coded solution also to understand a bit more the way the stuff works, and i have already too much plugin’s 😉

    After digging a lot i finally founded a solution…I was looking on buddypress level, but in fact the navigation menu is generated from the wordpress admin bar.

    All is on the global variable $wp_admin_bar, an instance from a wordpress class that generate the menu, it has a $node property, an array containing all the menu items.

    The class has several methods to manipulate node, so for example if you want to delete the Activity group links, i need to call the remove_node method as :


    function modify_admin_nav() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_node( 'my-account-activity' );
    }

    add_action( 'admin_bar_menu', 'modify_admin_nav', 100 );

    …and this only works with the ‘admin_bar_menu’ hook !

    more infos here

    Cheers.

    ++
    Khelil