- Timestamp:
- 05/03/2024 04:45:20 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/style-engine/class-wp-style-engine-processor.php
r56574 r58089 59 59 * 60 60 * @since 6.1.0 61 * @since 6.6.0 Added support for rules_group. 61 62 * 62 63 * @param WP_Style_Engine_CSS_Rule|WP_Style_Engine_CSS_Rule[] $css_rules A single, or an array of, … … 71 72 72 73 foreach ( $css_rules as $rule ) { 73 $selector = $rule->get_selector(); 74 $selector = $rule->get_selector(); 75 $rules_group = $rule->get_rules_group(); 76 77 /** 78 * If there is a rules_group and it already exists in the css_rules array, 79 * add the rule to it. 80 * Otherwise, create a new entry for the rules_group. 81 */ 82 if ( ! empty( $rules_group ) ) { 83 if ( isset( $this->css_rules[ "$rules_group $selector" ] ) ) { 84 $this->css_rules[ "$rules_group $selector" ]->add_declarations( $rule->get_declarations() ); 85 continue; 86 } 87 $this->css_rules[ "$rules_group $selector" ] = $rule; 88 continue; 89 } 90 91 // If the selector already exists, add the declarations to it. 74 92 if ( isset( $this->css_rules[ $selector ] ) ) { 75 93 $this->css_rules[ $selector ]->add_declarations( $rule->get_declarations() ); … … 118 136 $css = ''; 119 137 foreach ( $this->css_rules as $rule ) { 138 // See class WP_Style_Engine_CSS_Rule for the get_css method. 120 139 $css .= $rule->get_css( $options['prettify'] ); 121 140 $css .= $options['prettify'] ? "\n" : '';
Note: See TracChangeset
for help on using the changeset viewer.