Skip to:
Content
Pages
Categories
Search
Top
Bottom

What is the best way to add new items to the admin bar?

  • Profile photo of Sebastianmacias
    sebastianmacias
    Participant

    @sebastianmacias

    Hi,

    I need to be able to add new items to the admin bar and alter existing items. Does anyone know what would be a good way to do that without having to hack BP core code?

    Thanks,

    Seb

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    https://buddypress.org/forums/topic.php?id=1314 start there. Look at the code for bp-core-adminbar.php

    Create a function that is your new top level item and submenus. Use add_action() to hook up the new function/menu item.

    Profile photo of Fishbowl81
    fishbowl81
    Participant

    @fishbowl81

    add_action( 'bp_adminbar_menus', 'bp_adminbar_custom_menu', 40 );
    
    function bp_adminbar_custom_menu() {
    ?>
    
    <li>
    <a>"<?php _e( 'Custom Pulldown', 'buddypress' ) ?></a>
    
    <ul>List Item</ul>
    </li>
    <?php
    }
    Profile photo of Nicola Greco
    nicolagreco
    Participant

    @nicolagreco

    Remember to include the content as a list item! <li>or it will not appear fine :)

    Nicola

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What is the best way to add new items to the admin bar?’ is closed to new replies.