You have to create a new array for the new item and pass the parent
parameter as the id of this already created item.
In your case, the args array should be like this:
$args = array(
'id' => 'my-item',
'title' => 'My Item',
'href' => '#',
'parent' => 'theme_page',
'meta' => array(
'title' => __('Click Me'),
),
);
This post has a complete explanation of how and where you can add items to the admin bar and the usage of the parent
parameter.
Related Posts:
- Add visit site to your toolbar instead of being in the dropdown
- Add highlighting to new Admin Dashboard Menu Item
- WordPress setting API strucked
- Show admin menu and toolbar in admin post page
- How to change menu page capability
- Why add_menu_page adds admin.php and how to remove it?
- Is there any way to add absolute path for add_menu_page function?
- Set different custom menu items for different user roles
- toolbar not visible on pages using front-page template
- WordPress add page under admin submenu and retaining the active status of the parent submenu page in the menu
- Different Admin language
- add sub_menu to a sub_menu (multiLevel sub_menu) in admin menu in wordpress
- How to remove an item from menu bar’s +New menu based on User role
- How can I place a page link to the sidebar admin bar?
- How Do I create multiple Top Level Admin Menu Pages To submit data to the options table?
- How can I modify text in admin bar?
- Settings API – Checkboxes validation in a menu with multiple subpages
- How to include the admin bar?
- The Great WordPress Admin Menu Challenge of Jan 2011 (a.k.a. How to Resolve Some Challenges when Modifying the WordPress Admin Menu System?)
- Custom Post Type Settings page, choose page to display archive
- Add an admin page, but don’t show it on the admin menu
- Getting custom admin submenu item to highlight when its active
- Show Custom Taxonomy Inside Custom Menu
- Are there any reasons you can’t use strings for admin menu positions?
- What’s the best method for emptying an option created with the Settings API?
- List table not rendering when $this->items is filled
- Modify Admin Bar Link
- Edit specific nodes in WP_Admin_Bar
- How to check if an admin (sub)menu already exists?
- Adding an admin page – OOP approach not working
- Generate Advanced Custom Fields box in custom admin menu page
- How to Add Admin Bar and Admin Menu or Submenu Notification Bubbles?
- difference between add_object_page and add_menu_page
- Remove menus and submenus
- Add Admin Menu Inside Construct or Init
- add logout button on admin side menu
- Admin custom option screen not saved unless user manage_options capability
- WordPress admin menu formatting issue
- Admin Menu – Highlight top-level menu when on a sub-menu page (without showing sub-menu)
- How to prevent parent admin page from appearring as a child admin page
- Admin Menus – Name Menu different from first Submenu [duplicate]
- How to minimize WP dashboard menu programmatically?
- How to determin which admin screen/sub screen I’m currently viewing
- Add post-new.php?post_cat=catslug to admin menu
- Admin menu bar dropdown opens when I click on a form element (Chrome) [closed]
- Change URL of plugin admin menu
- How to add_menu_page include a php file page from theme directory
- Wp menu add page link as custom empty link
- How do I demote a menu item in the admin menu?
- Is it possible to pass variables from add_user_page?
- place a direct link to custom-stylesheet, under appearance menu in wp-admin
- Is there a limit to the number of items that can be added using the Appearance Menus Screen?
- Wrong current class on admin menu with add_submenu_page()
- Manipulate javascript code from custom made admin page menu
- Add menu option to “New Post” menu in admin bar
- Role capability issue
- Pagination in plugin’s backend
- What action/filter/function determines “current” class in WP Admin Menu
- ‘Headers already sent’ Error When Redirecting from add_submenu_page() Callback
- meta box on new admin page
- Use Drag & Drop Functionality from WordPress Admin Area in the Frontend?
- Adding admin top-level menus
- Disordered sidebar in admin panel of self-hosted blog network [duplicate]
- How to rename Profile link in wp-admin page
- Additional menu item popping in submenus
- how to save checkbox data for custom setting?
- How to align the top of an admin pointer to the target element?
- Adding menu item to WordPress admin bar for editors to edit one plugin’s settings
- Moving Smush plugin menu position to media submenu and removing it from main menu
- add submenu page doesn’t display
- Moving the WordPress dashboard avatar over the admin menu
- update_option does not work in this scenario – how do I fix?
- How to reference an existing css content-based icon, within my admin menu hook
- Margin problem on management menu?
- How can I move Customizer menu item to first level in WP Dashboard?
- How can I restrict a custom WordPress role access to only a specific plugin?
- How can I reorder admin bar items?
- Admin sidebar customization
- Pause plugin option page until all data manipulation is complete
- How to make an admin plugin menu page go full screen?
- Weird white space in admin area
- WordPress Settings API Overrides My Previous Value
- How to add a notification next to custom admin menu?
- admin menu: use default “general” page for theme settings using add_menu_page and add_submenu_page
- no themes or editor under appearance menu
- add menu page in loop menu order
- how to create pages and link them to a menu
- how to remove wp admin menu created by plugin
- Renaming post to something else, breaks dashboard if edit_posts is false
- Headers already sent error when creating multiple admin menu’s
- Removing admin menu items with white spaces
- Admin tabs for custom plugin
- Restricted access for other user roles
- Remove the theme info from main dashboard screen- not appearance
- Turn on again old expandable menu
- How to unset adminmenu completely?
- Plugin link does not appear in my toolbar
- Add items to the dark menu in WordPress
- Adding admin link to Appearance via admin_menu, adds link to theme details modal
- Remove menu pages only for non admin