Skip to content

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

Closed
dhananjaykuber wants to merge 7 commits intoWordPress:trunkfrom
dhananjaykuber:update/edit-site-editor-link
Closed

Update "Edit site" admin bar link to open Site Editor at top level#63835
dhananjaykuber wants to merge 7 commits intoWordPress:trunkfrom
dhananjaykuber:update/edit-site-editor-link

Conversation

@dhananjaykuber
Copy link
Copy Markdown
Contributor

Fixes #63785

What?

This PR updates the "Edit site" admin bar control to consistently open the Site Editor at the top level, rather than opening the specific template editing view of the current page.

Why?

This change is necessary to improve user experience and consistency within the WordPress editor. Currently, the "Edit site" control behaves unpredictably, dropping users into various levels of the Site Editor depending on the page they're viewing. This can be disorienting and makes the control less effective as an entry point to the Site Editor.

By making this change, we align the behavior with the "Editor" control in the WP Admin > Appearance menu, providing a more predictable and consistent experience for users.

How?

The implementation involves modifying the link destination of the "Edit site" admin bar control. Instead of linking to the specific template editing view, it will now link to the top-level Site Editor page.

$wp_admin_bar->add_node(
	array(
	        'id'    => 'site-editor',
		'title' => __( 'Edit site' ),
		'href'  => admin_url( 'site-editor.php' ),
	)
);

Testing Instructions

  1. Ensure you're using a block-based theme.
  2. Visit different pages on your site's front-end (homepage, a blog post, a static page, etc.).
  3. Click the "Edit site" link in the admin bar for each of these pages.
  4. Verify that regardless of which page you're on, clicking "Edit site" always takes you to the top-level Site Editor view.
  5. Confirm that you're not dropped into a specific template editing view.

Screenshots or screencast

Screen.Recording.2024-07-23.at.11.51.31.AM.mov

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 23, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhananjaykuber <dhananjaykuber@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ndiego <ndiego@git.wordpress.org>
Co-authored-by: bph <bph@git.wordpress.org>
Co-authored-by: markhowellsmead <markhowellsmead@git.wordpress.org>
Co-authored-by: sethrubenstein <smrubenstein@git.wordpress.org>
Co-authored-by: bacoords <bacoords@git.wordpress.org>
Co-authored-by: andreawetzel <awetz583@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: luminuu <luminuu@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: paaljoachim <paaljoachim@git.wordpress.org>
Co-authored-by: JosVelasco <josvelasco@git.wordpress.org>
Co-authored-by: unscripted <cwhitmore@git.wordpress.org>
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: ptesei <mosne@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed in the 6.7 folder, not 6.6.

@richtabor
Copy link
Copy Markdown
Member

@dhananjaykuber do you mind addressing the feedback? Thanks!

@richtabor richtabor added the [Type] Enhancement A suggestion for improvement. label Nov 8, 2024
@carolinan
Copy link
Copy Markdown
Contributor

Hi
Since 6.7 has already been released, this folder can't be used. It needs to be in a folder for the next major release.

@dhananjaykuber
Copy link
Copy Markdown
Contributor Author

Hi @carolinan,
Thank you for pointing that out. I’ll ensure that this is added to the folder for the next major release.

@richtabor
Copy link
Copy Markdown
Member

Intrigued to get this in a good state. What can I do to help?

I'm seeing more and more WordPress users getting unintentionally placed in the Site Editor by selecting this; resulting in getting lost/confused.

@carolinan
Copy link
Copy Markdown
Contributor

I am closing this in favor of #69271 because there are some changes in this PR that are unrelated to the issue.

@carolinan carolinan closed this Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the “Edit site” admin bar control to open the Site Editor at the top-level, consistently

3 participants