Stores a CSS rule using the provided CSS selector and CSS declarations.
$store_namestringrequired
$css_selectorstringrequired
$selector { ...rules } otherwise a concatenated string of properties and values.$css_declarationsstring[]required
array( "$property" => "$value", "$property" => "$value" ).$rules_groupstringoptional
@media (min-width: 80rem) or @layer module.Default:''
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, $rules_group )->add_declarations( $css_declarations );
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_style_engine/store_css_rule