-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Move Site Editor command from @wordpress/editor package to @wordpress/core-commands
#71262
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
Move Site Editor command from @wordpress/editor package to @wordpress/core-commands
#71262
Conversation
…min dashboard - Site Editor command: Only shown on block themes with template creation permissions - Editor command: Always shown, opens new post creation Fixes WordPress#71257
|
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. |
|
Thanks for the PR! Let's confirm what the "Editor" command means first. See #71257 (comment) |
|
Isn't there already an Site editor is a nice addition. |
Yes, I think just adding the "Site Editor" command should be enough. See: #71257 (comment) |
Site Editor and Editor commands to admin dashboardSite Editor command to admin dashboard
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
I think the issue is intended to expose the existing "Open Site Editor" command to the admin page, so we don't need to change the label and icon. This means that we should use the label "Open Site Editor" and remove the icon.
Additionally, the command isn't necessary when a user is already in the site editor.
Please check the logic of the original implementation again:
gutenberg/packages/editor/src/components/commands/index.js
Lines 288 to 302 in c436c1d
| if ( canCreateTemplate && isBlockBasedTheme ) { | |
| const isSiteEditor = getPath( window.location.href )?.includes( | |
| 'site-editor.php' | |
| ); | |
| if ( ! isSiteEditor ) { | |
| commands.push( { | |
| name: 'core/go-to-site-editor', | |
| label: __( 'Open Site Editor' ), | |
| callback: ( { close } ) => { | |
| close(); | |
| document.location = 'site-editor.php'; | |
| }, | |
| } ); | |
| } | |
| } |
Site Editor command to admin dashboardSite Editor command from @wordpress/editor package to @wordpress/core-commands
Site Editor command from @wordpress/editor package to @wordpress/core-commandsSite Editor command from @wordpress/editor package to @wordpress/core-commands
|
@t-hamano thanks for the review. I've updated the PR to move the Site Editor command implementation from @wordpress/editor to @wordpress/core-commands as requested, rather than adding a duplicate. |
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
- The command appears in all screens except for the site editor
- The command doesn't appear if the user has no permission to access the site editor, or the active theme is not a block theme
Note: The failing CI is not related to this PR and has been fixed in trunk. See #71285

What?
Closes #71257
Moves the "Site Editor" navigation command from
@wordpress/editorpackage to@wordpress/core-commandspackage to make it available on wp-admin dashboard pages.Why?
The "Site Editor" command was only available in the post editor but missing from the admin dashboard Command Palette. The command existed in the
@wordpress/editorpackage but needed to be moved to@wordpress/core-commandsto be available across all admin contexts.How?
Testing Instructions
CmdorCtrl + K.screencast
Screen.Recording.2025-08-20.at.6.49.36.AM.mov
Screen.Recording.2025-08-20.at.6.48.57.AM.mov