Skip to content

Commit

Permalink
Change setting name to allowCustomContentAndWideSize
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Nov 28, 2023
1 parent 2a2c99d commit 511372f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/reference-guides/block-api/block-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ supports: {
- `allowVerticalAlignment`: type `boolean`, default value `true`
- `allowJustification`: type `boolean`, default value `true`
- `allowOrientation`: type `boolean`, default value `true`
- `allowCustomContentSize`: type `boolean`, default value `true`
- `allowCustomContentAndWideSize`: type `boolean`, default value `true`
This value only applies to blocks that are containers for inner blocks. If set to `true` the layout type will be `flow`. For other layout types it's necessary to set the `type` explicitly inside the `default` object.

Expand Down Expand Up @@ -616,7 +616,7 @@ For the `flex` layout type, determines display of the justification control in t

For the `flex` layout type only, determines display of the orientation control in the block toolbar.

### layout.allowCustomContentSize
### layout.allowCustomContentAndWideSize

- Type: `boolean`
- Default value: `true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Settings related to layout.
| contentSize | string | | |
| wideSize | string | | |
| allowEditing | boolean | true | |
| allowCustomContentSize | boolean | true | |
| allowCustomContentAndWideSize | boolean | true | |

---

Expand Down
8 changes: 4 additions & 4 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ class WP_Theme_JSON_Gutenberg {
'minHeight' => null,
),
'layout' => array(
'contentSize' => null,
'wideSize' => null,
'allowEditing' => null,
'allowCustomContentSize' => null,
'contentSize' => null,
'wideSize' => null,
'allowEditing' => null,
'allowCustomContentAndWideSize' => null,
),
'lightbox' => array(
'enabled' => null,
Expand Down
8 changes: 5 additions & 3 deletions packages/block-editor/src/layouts/constrained.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ export default {
layoutBlockSupport = {},
} ) {
const { wideSize, contentSize, justifyContent = 'center' } = layout;
const { allowJustification = true, allowCustomContentSize = true } =
layoutBlockSupport;
const {
allowJustification = true,
allowCustomContentAndWideSize = true,
} = layoutBlockSupport;
const onJustificationChange = ( value ) => {
onChange( {
...layout,
Expand Down Expand Up @@ -67,7 +69,7 @@ export default {
} );
return (
<>
{ allowCustomContentSize && (
{ allowCustomContentAndWideSize && (
<>
<div className="block-editor-hooks__layout-controls">
<div className="block-editor-hooks__layout-controls-unit">
Expand Down
2 changes: 1 addition & 1 deletion schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"type": "boolean",
"default": true
},
"allowCustomContentSize": {
"allowCustomContentAndWideSize": {
"description": "Enable or disable the custom content and wide size controls.",
"type": "boolean",
"default": true
Expand Down

0 comments on commit 511372f

Please sign in to comment.