Skip to content

Commit

Permalink
refactor: move admin-bar fix in wordpress 6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dhananjaykuber committed Jan 16, 2025
1 parent 8b1b8ef commit 90851cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Changes to the WordPress admin bar.
*
* @package gutenberg
* @package WordPress
*/

/**
Expand All @@ -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;
Expand All @@ -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 );
2 changes: 1 addition & 1 deletion lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down

0 comments on commit 90851cd

Please sign in to comment.