Skip to:
Content
Pages
Categories
Search
Top
Bottom

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

  • @sebastianmacias

    Participant

    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)
  • @burtadsit

    Participant

    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.

    @fishbowl81

    Participant
    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
    }

    @nicolagreco

    Participant

    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.
Skip to toolbar