-
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
Add: Template types to the patterns API. #3946
Add: Template types to the patterns API. #3946
Conversation
5c8da31
to
ca8fcae
Compare
ca8fcae
to
615a278
Compare
src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php
Outdated
Show resolved
Hide resolved
@@ -318,6 +318,7 @@ function _register_theme_block_patterns() { | |||
'blockTypes' => 'Block Types', | |||
'postTypes' => 'Post Types', | |||
'inserter' => 'Inserter', | |||
'templateTypes' => 'Template Types', |
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.
Needs to add Template Types
in Other settable fields https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/block-patterns.php#L297-L305?
…s-controller.php Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Thank you for the feedback @mukeshpanchal27 it was applied. Committed at 620760e. |
Thanks @jorgefilipecosta I can't see my name in props |
Hi @mukeshpanchal27, sorry for missing your name on the commit message I had an issue while formatting the message, but as referred in slack, your name was manually added to the props of the CPT on the system we use for props and should be accounted for in any stats. Thank you for the feedback! |
Backports WordPress/gutenberg#45814 into the core.
Testing
I pasted the following sample pattern on lib/compat/wordpress-6.2/block-patterns.php.
I opened the post editor and the developer tools and pasted
wp.apiFetch( { path: '/wp/v2/block-patterns/patterns' } ).then( console.log );
on the browser console.I verified that the API response for included query/template-type-test include 404 in the templateTypes.