Skip to content

Commit

Permalink
Remove custom prefix from theme.json support property
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Aug 30, 2021
1 parent 9e47db0 commit 3e12547
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class WP_Theme_JSON_Gutenberg {
),
'custom' => null,
'dimensions' => array(
'height' => null,
'customWidth' => null,
'height' => null,
'width' => null,
),
'layout' => array(
'contentSize' => null,
Expand Down
2 changes: 1 addition & 1 deletion lib/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
},
"dimensions": {
"height": false,
"customWidth": false
"width": false
},
"spacing": {
"customMargin": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/width.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function resetWidth( { attributes = {}, setAttributes } ) {
* @return {boolean} Whether width control is disabled.
*/
export function useIsWidthDisabled( { name: blockName } = {} ) {
const isDisabled = ! useSetting( 'dimensions.customWidth' );
const isDisabled = ! useSetting( 'dimensions.width' );
return ! hasWidthSupport( blockName ) || isDisabled;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function useHasHeight( { name, supports } ) {
}

function useHasWidth( { name, supports } ) {
const settings = useSetting( 'dimensions.customWidth', name );
const settings = useSetting( 'dimensions.width', name );

return settings && supports.includes( 'width' );
}
Expand Down

0 comments on commit 3e12547

Please sign in to comment.