From 511372fe685e96aaea00d51f140b4c16b25147f8 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 28 Nov 2023 11:36:47 +1100 Subject: [PATCH] Change setting name to `allowCustomContentAndWideSize` --- docs/reference-guides/block-api/block-supports.md | 4 ++-- .../theme-json-reference/theme-json-living.md | 2 +- lib/class-wp-theme-json-gutenberg.php | 8 ++++---- packages/block-editor/src/layouts/constrained.js | 8 +++++--- schemas/json/theme.json | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index 7fade99f4095d..7fd0e68c9bd8c 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -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. @@ -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` diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md index cf290d5505a46..24a5845381bfd 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -129,7 +129,7 @@ Settings related to layout. | contentSize | string | | | | wideSize | string | | | | allowEditing | boolean | true | | -| allowCustomContentSize | boolean | true | | +| allowCustomContentAndWideSize | boolean | true | | --- diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 192638f12abba..646c7abc59eaf 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -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, diff --git a/packages/block-editor/src/layouts/constrained.js b/packages/block-editor/src/layouts/constrained.js index 17983b2773c68..f86791391176f 100644 --- a/packages/block-editor/src/layouts/constrained.js +++ b/packages/block-editor/src/layouts/constrained.js @@ -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, @@ -67,7 +69,7 @@ export default { } ); return ( <> - { allowCustomContentSize && ( + { allowCustomContentAndWideSize && ( <>
diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 12a17ca80c688..782e59794a5d1 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -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