Skip to content

Commit

Permalink
Make dimensions support flag experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 8, 2021
1 parent b2c1bcd commit 20d74c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/block-supports/dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function gutenberg_register_dimensions_support( $block_type ) {
return;
}

$has_dimensions_support = gutenberg_block_has_support( $block_type, array( 'dimensions' ), false );
$has_dimensions_support = gutenberg_block_has_support( $block_type, array( '__experimentalDimensions' ), false );
$has_spacing_support = gutenberg_block_has_support( $block_type, array( 'spacing' ), false );

if ( $has_dimensions_support || $has_spacing_support ) {
Expand Down Expand Up @@ -62,7 +62,7 @@ function gutenberg_get_dimensions_styles( $block_type, $block_attributes ) {
return array();
}

$has_height_support = gutenberg_block_has_support( $block_type, array( 'dimensions', 'height' ), false );
$has_height_support = gutenberg_block_has_support( $block_type, array( '__experimentalDimensions', 'height' ), false );
$styles = array();

if ( $has_height_support ) {
Expand Down Expand Up @@ -126,7 +126,7 @@ function gutenberg_get_spacing_styles( $block_type, $block_attributes ) {
* @return boolean Whether to serialize dimensions support styles & classes.
*/
function gutenberg_skip_dimensions_serialization( $block_type ) {
$dimensions_support = _wp_array_get( $block_type->supports, array( 'dimensions' ), false );
$dimensions_support = _wp_array_get( $block_type->supports, array( '__experimentalDimensions' ), false );

return is_array( $dimensions_support ) &&
array_key_exists( '__experimentalSkipSerialization', $dimensions_support ) &&
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
useIsPaddingDisabled,
} from './padding';

export const DIMENSIONS_SUPPORT_KEY = 'dimensions';
export const DIMENSIONS_SUPPORT_KEY = '__experimentalDimensions';
export const SPACING_SUPPORT_KEY = 'spacing';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/api/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const __EXPERIMENTAL_STYLE_PROPERTY = {
},
height: {
value: [ 'dimensions', 'height' ],
support: [ 'dimensions', 'height' ],
support: [ '__experimentalDimensions', 'height' ],
},
lineHeight: {
value: [ 'typography', 'lineHeight' ],
Expand Down

0 comments on commit 20d74c6

Please sign in to comment.