-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Description
Referring to the Extending the Query Loop Block documentation, we can use the allowedControls property in the core/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, and sticky.
I tried to roll back to previous Gutenberg versions and discovered this issue doesn't happen in v19.2.
There's the additional logic of ! isTemplate that caused the issue.
Step-by-step reproduction instructions
Create a new block variation using this snippet:
registerBlockVariation(
'core/query',
{
name: 'testing-allowed-controls',
title: __( 'Testing Allowed Controls' ),
category: 'theme',
keywords: [],
scope: [ 'inserter' ],
attributes: {
namespace: 'testing-allowed-controls',
},
allowedControls: [],
innerBlocks: [],
isActive: [ 'namespace' ],
}
);
Go to 3 block editors:
- Site Editor > Templates > Index
- Site Editor > Templates > Single Posts
- Posts > Add New, or edit an existing post (e.g. "Sample Page")
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:
| Site Editor > Templates > Index | Site Editor > Templates > Single Posts | Post Editor (e.g. Sample Page) |
|---|---|---|
![]() |
![]() |
![]() |
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.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes


