Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Rename "Edit site" to "Design" and make it consistently visible in the admin bar #66894

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions lib/compat/wordpress-6.7/admin-bar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Changes to the WordPress admin bar.
*
* @package gutenberg
*/

/**
* Adds the "Design" link to the Toolbar.
*
* @since 6.7.0
*
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
*/
function gutenberg_admin_bar_design_menu( $wp_admin_bar ) {

// Don't show if a block theme is not activated.
if ( ! wp_is_block_theme() ) {
return;
}

// Don't show for users who can't edit theme options.
if ( ! current_user_can( 'edit_theme_options' ) ) {
return;
}

$wp_admin_bar->add_node(
array(
'id' => 'site-editor',
'title' => __( 'Edit site' ),
'href' => admin_url( 'site-editor.php' ),
)
);
}
remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 42 );
add_action( 'admin_bar_menu', 'gutenberg_admin_bar_design_menu', 43 );
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/compat/wordpress-6.6/post.php';

// WordPress 6.7 compat.
require __DIR__ . '/compat/wordpress-6.7/admin-bar.php';
require __DIR__ . '/compat/wordpress-6.7/block-templates.php';
require __DIR__ . '/compat/wordpress-6.7/blocks.php';
require __DIR__ . '/compat/wordpress-6.7/block-bindings.php';
Expand Down
Loading