Changeset 58028 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 04/22/2024 05:28:50 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r57987 r58028 1228 1228 1229 1229 foreach ( $base_styles_nodes as $base_style_node ) { 1230 $stylesheet .= $this->get_layout_styles( $base_style_node );1230 $stylesheet .= $this->get_layout_styles( $base_style_node, $types ); 1231 1231 } 1232 1232 } … … 1390 1390 * @since 6.3.0 Reduced specificity for layout margin rules. 1391 1391 * @since 6.5.1 Only output rules referencing content and wide sizes when values exist. 1392 * @since 6.5.3 Add types parameter to check if only base layout styles are needed. 1392 1393 * 1393 1394 * @param array $block_metadata Metadata about the block to get styles for. 1395 * @param array $types Optional. Types of styles to output. If empty, all styles will be output. 1394 1396 * @return string Layout styles for the block. 1395 1397 */ 1396 protected function get_layout_styles( $block_metadata ) {1398 protected function get_layout_styles( $block_metadata, $types = array() ) { 1397 1399 $block_rules = ''; 1398 1400 $block_type = null; … … 1543 1545 foreach ( $base_style_rules as $base_style_rule ) { 1544 1546 $declarations = array(); 1547 1548 // Skip outputting base styles for flow and constrained layout types if theme doesn't support theme.json. The 'base-layout-styles' type flags this. 1549 if ( in_array( 'base-layout-styles', $types, true ) && ( 'default' === $layout_definition['name'] || 'constrained' === $layout_definition['name'] ) ) { 1550 continue; 1551 } 1545 1552 1546 1553 if (
Note: See TracChangeset
for help on using the changeset viewer.