5

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?

enter image description here

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.

1

1 Answer 1

0

This is now hypothetically possible in Wordpress 6.4:

To disable the controls for all blocks, "allowEditing": false should be added to settings.layout, like so:

"settings": {
    "layout": {
        "allowEditing": false
    } 
} 

To disable the controls for individual blocks, add "allowEditing": false in settings.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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.