Changeset 61619
- Timestamp:
- 02/12/2026 05:06:08 AM (3 weeks ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
src/wp-includes/block-supports/dimensions.php (modified) (2 diffs)
-
src/wp-includes/class-wp-theme-json.php (modified) (10 diffs)
-
src/wp-includes/style-engine/class-wp-style-engine.php (modified) (1 diff)
-
tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php (modified) (1 diff)
-
tests/phpunit/tests/theme/wpThemeJson.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/dimensions.php
r61430 r61619 52 52 */ 53 53 function wp_apply_dimensions_support( $block_type, $block_attributes ) { 54 55 54 56 if ( wp_should_skip_block_supports_serialization( $block_type, 'dimensions' ) ) { 55 return array();57 return ; 56 58 } 57 59 58 $attributes = array(); 59 60 // Width support to be added in near future. 61 62 $has_min_height_support = block_has_support( $block_type, array( 'dimensions', 'minHeight' ), false ); 63 $block_styles = $block_attributes['style'] ?? null; 60 $block_styles = $block_attributes['style'] ?? null; 64 61 65 62 if ( ! $block_styles ) { … … 67 64 } 68 65 69 $skip_min_height = wp_should_skip_block_supports_serialization( $block_type, 'dimensions', 'minHeight' ); 70 $dimensions_block_styles = array(); 71 $dimensions_block_styles['minHeight'] = null; 72 if ( $has_min_height_support && ! $skip_min_height ) { 73 $dimensions_block_styles['minHeight'] = $block_styles['dimensions']['minHeight'] ?? null; 66 $dimensions_block_styles = array(); 67 $supported_features = array( 'minHeight', 'width' ); 68 69 foreach ( $supported_features as $feature ) { 70 $has_support = block_has_support( $block_type, array( 'dimensions', $feature ), false ); 71 $skip_serialization = wp_should_skip_block_supports_serialization( $block_type, 'dimensions', $feature ); 72 73 $dimensions_block_styles[ $feature ] = null; 74 75 if ( $has_support && ! $skip_serialization ) { 76 $dimensions_block_styles[ $feature ] = $block_styles['dimensions'][ $feature ] ?? null; 77 } 74 78 } 79 75 80 $styles = wp_style_engine_get_styles( array( 'dimensions' => $dimensions_block_styles ) ); 76 81 -
trunk/src/wp-includes/class-wp-theme-json.php
r61618 r61619 238 238 * @since 6.6.0 Added `background-[image|position|repeat|size]` properties. 239 239 * @since 6.7.0 Added `background-attachment` property. 240 240 241 * @var array 241 242 */ … … 302 303 'filter' => array( 'filter', 'duotone' ), 303 304 'box-shadow' => array( 'shadow' ), 305 304 306 'writing-mode' => array( 'typography', 'writingMode' ), 305 307 ); … … 397 399 * @since 6.9.0 Added support for `border.radiusSizes`. 398 400 * @since 7.0.0 Added type markers to the schema for boolean values. 401 399 402 * @var array 400 403 */ … … 436 439 'defaultAspectRatios' => null, 437 440 'minHeight' => null, 441 438 442 ), 439 443 'layout' => array( … … 529 533 * @since 6.5.0 Added support for `dimensions.aspectRatio`. 530 534 * @since 6.6.0 Added `background` sub properties to top-level only. 535 531 536 * @var array 532 537 */ … … 557 562 'aspectRatio' => null, 558 563 'minHeight' => null, 564 559 565 ), 560 566 'filter' => array( … … 656 662 * 657 663 * @since 6.1.0 664 658 665 * @var string[] 659 666 */ … … 661 668 '__experimentalBorder' => 'border', 662 669 'color' => 'color', 670 663 671 'spacing' => 'spacing', 664 672 'typography' => 'typography', … … 765 773 * @since 6.4.0 Added `background.backgroundImage`. 766 774 * @since 6.5.0 Added `background.backgroundSize` and `dimensions.aspectRatio`. 775 767 776 * @var array 768 777 */ … … 780 789 array( 'dimensions', 'aspectRatio' ), 781 790 array( 'dimensions', 'minHeight' ), 791 782 792 array( 'position', 'sticky' ), 783 793 array( 'spacing', 'blockGap' ), -
trunk/src/wp-includes/style-engine/class-wp-style-engine.php
r60892 r61619 220 220 ), 221 221 ), 222 223 224 225 226 227 222 228 ), 223 229 'spacing' => array( -
trunk/tests/phpunit/tests/block-supports/wpApplyDimensionsSupport.php
r55175 r61619 101 101 ); 102 102 } 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 103 174 } -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r61618 r61619 282 282 'aspectRatio' => true, 283 283 'minHeight' => true, 284 284 285 ), 285 286 'position' => array( … … 321 322 'aspectRatio' => true, 322 323 'minHeight' => true, 324 323 325 ), 324 326 'position' => array(
Note: See TracChangeset
for help on using the changeset viewer.