Skip to content
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

Conversation

aaronrobertshaw
Copy link

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.

Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
'core/' . $core_block_pattern,
require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php'
);
$pattern = require ABSPATH . WPINC . '/block-patterns/' . $core_block_pattern . '.php';
Copy link
Contributor

@talldan talldan Jun 26, 2023

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.

Copy link
Author

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.

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.
Copy link
Contributor

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.

Copy link
Member

@ramonjd ramonjd left a 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.

Screenshot 2023-06-27 at 7 51 59 pm

@tellthemachines
Copy link
Contributor

committed in r56063 / c27f776.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

5 participants