-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Expose the Site Editor Patterns page for all classic themes #6480
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 Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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.
I think this looks good, @t-hamano. It'll be great to resolve the awkward links between Patterns and Template Parts into the site editor's Patterns menu 👍🏻
I'd like to recommend this for commit
.
Agree with @ironprogrammer, code looks good. The only thing I'm a bit unsure about is the part of site-editor.php that deals with template parts and non-block themes: https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/site-editor.php#L22-L35. If the template parts menu item is removed, does that code need updating too? |
Thanks for the review!
The code here, i.e. |
I think it's because the latest Gutenberg hasn't been merged into core yet, although JS redirection is implemented here. I feel that if we implement PHP redirection in the core, JS redirection in Gutenberg might be unnecessary. |
Yes, thinking so too. Generally PHP redirects are preferable as they run faster (the browser stops loading the current page and redirects as soon as it receives the header of the response). |
I think JS redirection is probably necessary here because the site editor is an SPA and folks (third-parties) can navigate to URLs without actually reaching the server. |
With changeset 58187, The JS side redirect is now reflected in the core. Do we also need a PHP redirect just in case? |
I don't think it's needed personally. This PR seems ready to ship for me. |
Checking WP Directory for use of |
Committed in https://core.trac.wordpress.org/changeset/58278 |
Trac ticket: https://core.trac.wordpress.org/ticket/61109
Summary
This PR makes the following changes in the classic theme.
wp-admin/site-editor.php?path=/patterns
)About Menu Structure
It's a little confusing what the index of the submenu that
$submenu['themes.php']
has, but for the submenu that this PR relates to, it should be as follows.Block Theme
Classic Theme
Screenshots
Block Theme (Twenty Twenty-Four)
It's no different than before.
Classic Theme (Twenty Twenty-One)
The menu structure remains the same, but the Patterns submenu now links to the Site Editor's Patterns page.
Classic theme with
block-template-parts
supportThe Template Part submenu has been removed and the Patterns submenu now links to the Site Editor's Patterns page.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.