-
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
Extensibility: Pass the post object to allowed_block_types
filter
#6208
Conversation
1aa6a05
to
f92b60f
Compare
@zgordon - can you give it a try? |
@gziolo do I just pill down latest Master to try this? |
Rather this branch: update/extensibility-allowed-block-types. |
lib/client-assets.php
Outdated
@@ -937,8 +937,9 @@ function gutenberg_editor_scripts_and_styles( $hook ) { | |||
* | |||
* @param bool|array $allowed_block_types Array of block type slugs, or | |||
* boolean to enable/disable all. | |||
* @param object The post resource data. |
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.
This @param
comment is missing the name of the argument.
(It's weird that the linter didn't yell about this.)
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.
It's not a function, so it's tricky for both human and computer. I updated :)
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.
👍 nice. This looks good to me once that @param
is fixed up.
Sweet! @gziolo can confirm it's working for me as expected :) |
f92b60f
to
5b4000e
Compare
Description
Closes #2685.
This PR open an access to the current post to the
allowed_block_types
filter to make it possible to provide a different set of allowed block types per post type or based on other properties.How has this been tested?
Manually added the following filter:
Types of changes
Improvement.
Checklist: