W3cubDocs

/WordPress

WP_Style_Engine_CSS_Rule::__construct( string $selector = , string[]|WP_Style_Engine_CSS_Declarations $declarations = array(), string $rules_group = )

Constructor.

Parameters

$selectorstringoptional
The CSS selector.

Default:''

$declarationsstring[]|WP_Style_Engine_CSS_Declarationsoptional
An associative array of CSS definitions, e.g. array( "$property" => "$value", "$property" => "$value" ), or a WP_Style_Engine_CSS_Declarations object.

Default:array()

$rules_groupstringoptional
A parent CSS selector in the case of nested CSS, or a CSS nested @rule, such as @media (min-width: 80rem) or @layer module.

Default:''

Source

public function __construct( $selector = '', $declarations = array(), $rules_group = '' ) {
	$this->set_selector( $selector );
	$this->add_declarations( $declarations );
	$this->set_rules_group( $rules_group );
}

Changelog

Version Description
6.6.0 Added the $rules_group parameter.
6.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_style_engine_css_rule/__construct