Since WP 5.8 we can define various settings in the theme.json
which is much appreciated and really helpful. But there are still some options I cannot find, e.g. how can I remove the layout panel from the core/group
block?
In theme.json, I tried (not sure about the layout
-key):
{
// ...
"settings": {
// ...
"blocks": {
"core/group": {
"layout": false // or [] or {} <-- no effect
}
}
}
}
or
{
// ...
"settings": {
// ...
"blocks": {
"core/group": {
"layout": {
"customLayout": false // <-- no effect
}
}
}
}
}
The following answers here were quite close:
So my question is
Where can I find a complete list of all the possible settings for core-blocks in theme.json
?
Alas, the official twentytwentyone theme does not contain a such file.
Since WP 5.8 we can define various settings in the theme.json
which is much appreciated and really helpful. But there are still some options I cannot find, e.g. how can I remove the layout panel from the core/group
block?
In theme.json, I tried (not sure about the layout
-key):
{
// ...
"settings": {
// ...
"blocks": {
"core/group": {
"layout": false // or [] or {} <-- no effect
}
}
}
}
or
{
// ...
"settings": {
// ...
"blocks": {
"core/group": {
"layout": {
"customLayout": false // <-- no effect
}
}
}
}
}
The following answers here were quite close:
So my question is
Where can I find a complete list of all the possible settings for core-blocks in theme.json
?
Alas, the official twentytwentyone theme does not contain a such file.
This is now hypothetically possible in Wordpress 6.4:
To disable the controls for all blocks,
"allowEditing": false
should be added tosettings.layout
, like so:"settings": { "layout": { "allowEditing": false } }
To disable the controls for individual blocks, add
"allowEditing": false
insettings.blocks.[block name].layout
, thus:"settings": { "blocks": { "core/cover": { "layout": { "allowEditing": false } } } }
However, disabling layout makes the row/stack block variations useless since all the alignment controls disappear along with the content/wide size stuff.