Command Palette: Fix duplicate Patterns command#54133
Merged
Conversation
|
Size Change: -117 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
647cad1 to
bd8e730
Compare
bd8e730 to
ccbf751
Compare
t-hamano
commented
Sep 3, 2023
| document.location.href = 'edit.php?post_type=wp_block'; | ||
| } | ||
| }, | ||
| icon: isSiteEditor ? symbol : external, |
Contributor
Author
There was a problem hiding this comment.
Minor enhancement: I don't think this command is an "External" command, whether you are inside or outside the Site Editor.
glendaviesnz
approved these changes
Sep 3, 2023
Contributor
glendaviesnz
left a comment
There was a problem hiding this comment.
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.
aaronrobertshaw
approved these changes
Sep 4, 2023
Contributor
aaronrobertshaw
left a comment
There was a problem hiding this comment.
Looks good, thanks for the quick fix @t-hamano 👍
✅ No change in the patterns command function
✅ There's now only a single patterns command
Contributor
Author
|
Thanks for the review, @glendaviesnz, @aaronrobertshaw! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jspackages/core-commands/src/site-editor-navigation-commands.jsAs 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.