WP_Style_Engine_CSS_Rule::__construct
Constructor.
Method of the class: WP_Style_Engine_CSS_Rule{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$WP_Style_Engine_CSS_Rule = new WP_Style_Engine_CSS_Rule(); $WP_Style_Engine_CSS_Rule->__construct( $selector, $declarations, $rules_group );
- $selector(string)
- The CSS selector.
Default: empty string - $declarations(string[]|WP_Style_Engine_CSS_Declarations)
- An associative array of CSS definitions, e.g. array( "$property" => "$value", "$property" => "$value" ), or a WP_Style_Engine_CSS_Declarations object.
Default: empty array - $rules_group(string)
- 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: ''
Changelog
Since 6.1.0 | Introduced. |
Since 6.6.0 | Added the $rules_group parameter. |
WP_Style_Engine_CSS_Rule::__construct() WP Style Engine CSS Rule:: construct code WP 6.8.1
public function __construct( $selector = '', $declarations = array(), $rules_group = '' ) { $this->set_selector( $selector ); $this->add_declarations( $declarations ); $this->set_rules_group( $rules_group ); }