-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Pattern Directory API: Pass through the pattern's blockTypes to support pattern transforms #32113
Conversation
Size Change: 0 B Total Size: 1.86 MB ℹ️ View Unchanged
|
26ae61e
to
453bee1
Compare
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.
LGTM, kudos for the very clean commits!
Core uses |
Since this is used directly by the JS, I thought it better to keep it |
Yeah it should still be |
ahh, I see. Okay, I'll make the change back to snake_case. |
053aa21
to
ea1e36e
Compare
I've updated the PR to use |
5fdc488
to
05011d4
Compare
e14f54c
to
4bedabf
Compare
This PR has been updated since it was originally created - now it updates the Patterns API response using filters, so that it will affect both the core endpoint in 5.8+, and the GB endpoint on older sites. It adds a I also noticed that the |
4bedabf
to
c4881c0
Compare
Updated this PR to apply to the new Featured category of patterns as well. Still only the "Heading" and "Quote" patterns have |
There have been changes since this approval
Description
In WordPress/pattern-directory#111, we added a
blockTypes
property to patterns in the Pattern Directory. This is returned in the API endpointhttp://api.wordpress.org/patterns/1.0/
as an array inmeta.wpop_block_types
for each pattern.This PR updates the local endpoint to pass through that
blockTypes
property and use it when registering remote blocks.See #28800
How has this been tested?
/wp-json/wp/v2/pattern-directory/patterns
block_types
propertyThe quote block also has a pattern transform if you want to test that too :)