-
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
Patterns: Allow for filtering of block patterns by source #4697
Patterns: Allow for filtering of block patterns by source #4697
Conversation
Co-authored-by: Mukesh Panchal <[email protected]>
src/wp-includes/block-patterns.php
Outdated
'core/' . $core_block_pattern, | ||
require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php' | ||
); | ||
$pattern = require ABSPATH . WPINC . '/block-patterns/' . $core_block_pattern . '.php'; |
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 the path was only changed in the gutenberg plugin because the plugin is in a different directory.
No need to bring this change over to core.
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.
Thank you for explaining that 👍
I did a brief check elsewhere in core and saw similar approaches in defining required paths, so mistakenly brought that over.
src/wp-includes/block-patterns.php
Outdated
require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php' | ||
); | ||
$pattern = require ABSPATH . WPINC . '/block-patterns/' . $core_block_pattern . '.php'; | ||
$pattern['source'] = 'core'; // Added in 6.3.0. |
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.
The 'Added in 6.3.0' comments are useful in the Gutenberg plugin, but not so useful here, so I think they can be removed.
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 merged this into
Which has the latest Gutenberg packages
Functionality, as described in WordPress/gutenberg#51672 works well.
✅ Explore the library categories and ensure that only template parts, theme patterns, and reusable blocks are shown.
This is a backport PR for WordPress 6.3 that includes the following PHP Gutenberg changes:
Trac ticket: https://core.trac.wordpress.org/ticket/58622
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.