-
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
Since Gutenberg v19.3, allowedControls
in core/query
block variation are ignored in Site Editor's singular template editor and post editor
#65902
Comments
@daviedR does the previous functionality work in WordPress 6.6.2 without Gutenberg active? |
Yes, it works in WP 6.6.2 without Gutenberg plugin. |
I think #65067 is related, but do you know if what's reported here is a bug or expected behavior? If it is expected, the documentation may need to be updated. |
Thanks for the ping, @t-hamano. I agree, this is not the intended behaviour. I'll look into this as soon as possible. |
Thanks for the feedback everyone, I am going to list this as a regression. |
Description
Referring to the Extending the Query Loop Block documentation, we can use the
allowedControls
property in thecore/query
block variation definition to include only some of the controls in the editor.For example, if a block variation defines:
allowedControls: []
, the block variation will not display any controls.However, since Gutenberg v19.3, I have found that some controls are always displayed even if they are not defined in the
allowedControls
array when in the Site Editor's singular template editor and post editor. This issue doesn't occur in the Site Editor's index template editor.Some of the affected controls are:
postType
,order
, andsticky
.I tried to roll back to previous Gutenberg versions and discovered this issue doesn't happen in v19.2.
Changes in v19.3:
https://github.com/WordPress/gutenberg/blob/v19.3.0/packages/block-library/src/query/edit/inspector-controls/index.js#L125
Compared to v19.2:
https://github.com/WordPress/gutenberg/blob/v19.2.0/packages/block-library/src/query/edit/inspector-controls/index.js#L109
There's the additional logic of
! isTemplate
that caused the issue.Step-by-step reproduction instructions
Create a new block variation using this snippet:
Go to 3 block editors:
Add the
Testing Allowed Controls
query block variation into the block editor content via the inserter. Choose any inner blocks template.Check the available controls in the block options panel (right sidebar).
Screenshots, screen recording, code snippet
Using the snippet above, these are 3 different screenshots:
Environment info
WordPress 6.7 beta1
OR
WordPress 6.6.2
Gutenberg 19.3
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: