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

Update "Edit site" admin bar link to open Site Editor at top level #63835

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
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
13 changes: 1 addition & 12 deletions lib/compat/wordpress-6.6/admin-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
* @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.
*
* @global string $_wp_current_template_id
*
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
*/
function gutenberg_admin_bar_edit_site_menu( $wp_admin_bar ) {
global $_wp_current_template_id;

// Don't show if a block theme is not activated.
if ( ! wp_is_block_theme() ) {
return;
Expand All @@ -33,14 +29,7 @@ function gutenberg_admin_bar_edit_site_menu( $wp_admin_bar ) {
array(
'id' => 'site-editor',
'title' => __( 'Edit site' ),
'href' => add_query_arg(
array(
'postType' => 'wp_template',
'postId' => $_wp_current_template_id,
'canvas' => 'edit',
),
admin_url( 'site-editor.php' )
),
'href' => admin_url( 'site-editor.php' ),
)
);
}
Expand Down
Loading