WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add new item to Admin Bar (2 posts)

  1. Terry Sutton (saltcod)
    Member
    Posted 3 years ago #

    Hi all,

    I've been able to easily add new items to the Admin Bar under the parents "Appearance" or "Comments".

    What I can't figure out is how to add new items to the "My Account" parent item. I can't figure out its name.

    I want the menu to be something like:
    -Edit My Profile
    -Dashboard
    -Logout
    -View all posts
    -View settings
    etc...

    What is the name of the "My Account" parent item?

    If I know its name, I can just do the following:

    $wp_admin_bar->add_menu( array(
            'parent' => 'MY ACCOUNT',
            'id' => 'edit',
            'title' => __('View all posts'),
            'href' => admin_url( 'edit.php')
        ) );

    Help appreciated!

  2. Terry Sutton (saltcod)
    Member
    Posted 3 years ago #

    Resolved. I swear I searched before I posted this question.

    The name of the "My Account" parent item is either my-account or my-account-with-avatar if you have an avatar up there.

    WP-Snippets has all the detail you need.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags