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

Conversation

dhananjaykuber
Copy link
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

Copy link

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 <sayhellogmbh@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>

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

Copy link
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
Member

@dhananjaykuber do you mind addressing the feedback? Thanks!

@richtabor richtabor added the [Type] Enhancement A suggestion for improvement. label Nov 8, 2024
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