diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:51:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:51:18 +0000 |
commit | 0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch) | |
tree | e139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/style-engine/class-wp-style-engine.php | |
parent | Adding upstream version 6.5.5+dfsg1. (diff) | |
download | wordpress-0e41b5d52fdc6af6442816b5f465c9db9f84e126.tar.xz wordpress-0e41b5d52fdc6af6442816b5f465c9db9f84e126.zip |
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/style-engine/class-wp-style-engine.php')
-rw-r--r-- | wp-includes/style-engine/class-wp-style-engine.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wp-includes/style-engine/class-wp-style-engine.php b/wp-includes/style-engine/class-wp-style-engine.php index 99372b5..1ba813e 100644 --- a/wp-includes/style-engine/class-wp-style-engine.php +++ b/wp-includes/style-engine/class-wp-style-engine.php @@ -364,6 +364,7 @@ final class WP_Style_Engine { * Stores a CSS rule using the provided CSS selector and CSS declarations. * * @since 6.1.0 + * @since 6.6.0 Added the `$rules_group` parameter. * * @param string $store_name A valid store key. * @param string $css_selector When a selector is passed, the function will return @@ -371,12 +372,14 @@ final class WP_Style_Engine { * otherwise a concatenated string of properties and values. * @param string[] $css_declarations An associative array of CSS definitions, * e.g. `array( "$property" => "$value", "$property" => "$value" )`. + * @param string $rules_group Optional. A parent CSS selector in the case of nested CSS, or a CSS nested @rule, + * such as `@media (min-width: 80rem)` or `@layer module`. */ - public static function store_css_rule( $store_name, $css_selector, $css_declarations ) { + public static function store_css_rule( $store_name, $css_selector, $css_declarations, $rules_group = '' ) { if ( empty( $store_name ) || empty( $css_selector ) || empty( $css_declarations ) ) { return; } - static::get_store( $store_name )->add_rule( $css_selector )->add_declarations( $css_declarations ); + static::get_store( $store_name )->add_rule( $css_selector, $rules_group )->add_declarations( $css_declarations ); } /** @@ -467,6 +470,7 @@ final class WP_Style_Engine { foreach ( $style_definition['classnames'] as $classname => $property_key ) { if ( true === $property_key ) { $classnames[] = $classname; + continue; } $slug = static::get_slug_from_preset_value( $style_value, $property_key ); |