Skip to content

Commit

Permalink
Nav Redesign i3: Hotfix the order of the admin menu items for WP 6.6 (#…
Browse files Browse the repository at this point in the history
…38347)

* Admin Bar: Hotfix the order of the admin menu items for WP 6.6

* changelog

* Change styles to keep the search at the rightmost
  • Loading branch information
arthur791004 authored Jul 17, 2024
1 parent b06a029 commit 7cc96a0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Admin Bar: Hotfix the order of the admin menu items for WP 6.6
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ function wpcom_enqueue_admin_bar_assets() {
array(),
Jetpack_Mu_Wpcom::PACKAGE_VERSION
);

/**
* Hotfix the order of the admin menu items due to WP 6.6
* See https://core.trac.wordpress.org/ticket/61615.
*/
$wp_version = get_bloginfo( 'version' );
if ( version_compare( $wp_version, '6.6', '<=' ) && version_compare( $wp_version, '6.6.RC', '>=' ) ) {
wp_add_inline_style(
'wpcom-admin-bar',
<<<CSS
#wpadminbar .quicklinks #wp-admin-bar-top-secondary {
display: flex;
flex-direction: row-reverse;
}
#wpadminbar .quicklinks #wp-admin-bar-top-secondary #wp-admin-bar-search {
order: -1;
}
CSS
);
}
}
add_action( 'admin_bar_menu', 'wpcom_enqueue_admin_bar_assets' );

Expand Down

0 comments on commit 7cc96a0

Please sign in to comment.