-
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
Command Palette: Fix duplicate Patterns command #54133
Conversation
Size Change: -117 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
647cad1
to
bd8e730
Compare
bd8e730
to
ccbf751
Compare
@@ -58,6 +59,5 @@ export function useAdminNavigationCommands() { | |||
document.location.href = 'edit.php?post_type=wp_block'; | |||
} | |||
}, | |||
icon: isSiteEditor ? symbol : external, |
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.
Minor enhancement: I don't think this command is an "External" command, whether you are inside or outside the Site Editor.
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.
Tested well for me. Just one Patterns command appeared and for a block theme it opened the site editor patterns page, and for classic and hybrid themes it opened the wp-admin wp_block list page.
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.
Looks good, thanks for the quick fix @t-hamano 👍
✅ No change in the patterns command function
✅ There's now only a single patterns command
Thanks for the review, @glendaviesnz, @aaronrobertshaw! |
Derived from this comment
What?
This PR fixes a duplicate command regarding pattern pages.
Why?
As part of #53496, a command regarding pattern pages was added. However, since a similar command was already added in #52817, I believe it was necessary to update the existing command.
How?
Removed the commands added in #53496 and updated the commands that were originally there.
One thing that is of interest is which of the following files this command should belong to.
packages/core-commands/src/admin-navigation-commands.js
packages/core-commands/src/site-editor-navigation-commands.js
As suggested in #54066, if the classic theme has access to the Patterns page of the Site Editor, this command should belong in the latter file. Currently, however, the classic theme does not have access to the Patterns page in the Site Editor, so it goes to the post list page with a post type of wp_block. Therefore, I believe it should belong in the former file for now.
Testing Instructions
To test all themes (Block Theme, Hybrid Theme, Classic Theme), it is better to use
localhost:8889/wp-admin
.wp_block
.wp_block
.