Title: Admin Toolbar menu has new, higher priority values
Author: Stephen Bernhardt
Published: September 10, 2024

---

 [  ](https://profiles.wordpress.org/sabernhardt/) [Stephen Bernhardt](https://profiles.wordpress.org/sabernhardt/)
2:31 pm _on_ September 10, 2024     
Tags: [6-6 ( 57 )](https://make.wordpress.org/core/tag/6-6/),
[dev-notes ( 647 )](https://make.wordpress.org/core/tag/dev-notes/), [dev-notes-6.6 ( 19 )](https://make.wordpress.org/core/tag/dev-notes-6-6/)

# Admin Toolbar menu has new, higher priority values

In WordPress 6.6, the [Search form moved to a high priority](https://make.wordpress.org/core/2024/06/25/miscellaneous-developer-changes-in-wordpress-6-6/#toolbar)
to position it at the end of the menu without using the CSSCSS Cascading Style Sheets.`
float` property. Then WordPress 6.6.1 moved the User Profile menu and Recovery Mode
to a high priority to keep them near the Search form.

 * Search form (`'search'`) from `4` to `9999`
 * User Profile (`'my-account'`) from `7` to `9991`
 * Exit Recovery Mode (`'recovery-mode'`) from `8` to `9992`

Using `get_node()` to manipulate one of these nodes in the `admin_bar_menu` hook
would require a higher priority now (such as `9999`).

To edit coreCore Core is the set of software required to run WordPress. The Core
Development Team builds WordPress. items without setting a specific priority, functions
can hook into `wp_before_admin_bar_render` instead. That requires declaring the `
$wp_admin_bar` global.

_Example: Replacing “Howdy” with “Hello” in the top profile link and in the ARIA
label for its submenu_

    ```notranslate
    /**
     * Replaces the "Howdy" text in the WP admin toolbar.
     *
     * @global WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
     */
    function wpdocs_replace_howdy_in_admin_bar() {
    	global $wp_admin_bar;

    	$my_account = $wp_admin_bar->get_node( 'my-account' );

    	// Return early if node contents are not available to edit.
    	if ( ! isset( $my_account->title ) || ! isset( $my_account->meta['menu_title'] ) ) {
    		return;
    	}

    	$wp_admin_bar->add_node(
    		array(
    			'id'    => 'my-account',
    			'title' => str_replace( 'Howdy,', 'Hello,', $my_account->title ),
    			'meta'  => array(
    				'menu_title' => str_replace( 'Howdy,', 'Hello,', $my_account->meta['menu_title'] ),
    			),
    		)
    	);
    }
    add_action( 'wp_before_admin_bar_render', 'wpdocs_replace_howdy_in_admin_bar' );
    ```

See [#61738](https://core.trac.wordpress.org/ticket/61738), [#61615](https://core.trac.wordpress.org/ticket/61615),
and [#60685](https://core.trac.wordpress.org/ticket/60685) for more details.

---

Props to [@audrasjb](https://profiles.wordpress.org/audrasjb/), [@joedolson](https://profiles.wordpress.org/joedolson/),
and [@hellofromtonya](https://profiles.wordpress.org/hellofromtonya/) for proofreading.

[#6-6](https://make.wordpress.org/core/tag/6-6/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#dev-notes-6-6](https://make.wordpress.org/core/tag/dev-notes-6-6/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2024/09/10/admin-toolbar-menu-has-new-higher-priority-values/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2024/09/10/admin-toolbar-menu-has-new-higher-priority-values/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2024/09/10/admin-toolbar-menu-has-new-higher-priority-values/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2024/09/10/admin-toolbar-menu-has-new-higher-priority-values/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2024/09/10/admin-toolbar-menu-has-new-higher-priority-values/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2024/09/10/admin-toolbar-menu-has-new-higher-priority-values/?share=linkedin)

# Post navigation

[← Performance Chat Agenda: 10 September 2024](https://make.wordpress.org/core/2024/09/10/performance-chat-agenda-10-september-2024/)

[Performance Chat Summary: 10 September 2024 →](https://make.wordpress.org/core/2024/09/10/performance-chat-summary-10-september-2024/)