From 90851cd25791422fbc062f60f881c78f1aab6b74 Mon Sep 17 00:00:00 2001 From: Dhananjay Kuber Date: Thu, 16 Jan 2025 12:10:06 +0530 Subject: [PATCH] refactor: move admin-bar fix in wordpress 6.8 --- .../{wordpress-6.7 => wordpress-6.8}/admin-bar.php | 10 +++++----- lib/load.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename lib/compat/{wordpress-6.7 => wordpress-6.8}/admin-bar.php (74%) diff --git a/lib/compat/wordpress-6.7/admin-bar.php b/lib/compat/wordpress-6.8/admin-bar.php similarity index 74% rename from lib/compat/wordpress-6.7/admin-bar.php rename to lib/compat/wordpress-6.8/admin-bar.php index 4c3dfa7da08524..635abae7a74ba2 100644 --- a/lib/compat/wordpress-6.7/admin-bar.php +++ b/lib/compat/wordpress-6.8/admin-bar.php @@ -2,7 +2,7 @@ /** * Changes to the WordPress admin bar. * - * @package gutenberg + * @package WordPress */ /** @@ -11,11 +11,11 @@ * @since 5.9.0 * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. * @since 6.6.0 Added the canvas argument to the url. - * @since 6.7.0 Changed to open Site Editor at top level instead of specific template. + * @since 6.8.0 Changed to open Site Editor at top level instead of specific template. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ -function gutenberg_admin_bar_edit_site_menu( $wp_admin_bar ) { +function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { // Don't show if a block theme is not activated. if ( ! wp_is_block_theme() ) { return; @@ -34,5 +34,5 @@ function gutenberg_admin_bar_edit_site_menu( $wp_admin_bar ) { ) ); } -remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 ); -add_action( 'admin_bar_menu', 'gutenberg_admin_bar_edit_site_menu', 41 ); + +add_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 ); diff --git a/lib/load.php b/lib/load.php index 1a36dbdc89755c..893d94c41d2658 100644 --- a/lib/load.php +++ b/lib/load.php @@ -87,7 +87,6 @@ function gutenberg_is_experiment_enabled( $name ) { // WordPress 6.7 compat. require __DIR__ . '/compat/wordpress-6.7/block-templates.php'; -require __DIR__ . '/compat/wordpress-6.7/admin-bar.php'; require __DIR__ . '/compat/wordpress-6.7/blocks.php'; require __DIR__ . '/compat/wordpress-6.7/block-bindings.php'; require __DIR__ . '/compat/wordpress-6.7/script-modules.php'; @@ -102,6 +101,7 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/compat/wordpress-6.8/post.php'; require __DIR__ . '/compat/wordpress-6.8/site-editor.php'; require __DIR__ . '/compat/wordpress-6.8/class-gutenberg-rest-user-controller.php'; +require __DIR__ . '/compat/wordpress-6.8/admin-bar.php'; // Experimental features. require __DIR__ . '/experimental/block-editor-settings-mobile.php';