-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Admin bar: Update the Edit Site link #69271
base: trunk
Are you sure you want to change the base?
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Flaky tests detected in 9e2d9b1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13449892303
|
@karmatosed @richtabor @WordPress/gutenberg-design Personally I prefer it to show in the admin area, (because I don't have to think). But I believe this is a change where there may be a difference of opinion and I don't want to commit a change that will then be a surprise. |
What?
Partial for #63785
Closes #63784 (based on #63785 (comment))
This PR changes the Edit Site link in the admin bar to point to the top level (the "home") of the Site Editor, instead of opening the current template.
Based on feedback in https://core.trac.wordpress.org/ticket/62368, the Edit Site link also shows in the admin area.
Showing the link while in the admin area makes the admin bar more consistent and makes it easier to use, since you can use your muscle memory.
This PR replaces two stale PR's: #66894 and #63835
How?
By using the filter, the current menu item is replaced, since they share the same id: "site-editor" (There is no need to remove the current menu item first, it is replaced).
The template global and the query args are removed, since they are no longer needed.
The capitalization is changed to Edit Site, to match a change that is already merged in to 6.8: https://core.trac.wordpress.org/ticket/62971
I used 41 as the priority, because it is what was used when the menu item was first added to Gutenberg, in a compat file that has since been deleted. I am not entirely sure what this is based on, but it is probably because themes have priority 40.
Testing Instructions
Activate a block theme.
Confirm that the Edit Site link shows in the admin bar, and that it leads to the Site Editor, without opening a specific template.
Activate a classic theme and confirm that the link does not show.
Screenshots or screencast
This screenshot shows the new link in the admin bar while in the admin area:
