On this page
WP_Style_Engine_CSS_Declarations::__construct( string[] $declarations = array() )
Constructor for this object.
Description
If a $declarations array is passed, it will be used to populate the initial $declarations prop of the object by calling add_declarations().
Parameters
$declarationsstring[] Optional-
An associative array of CSS definitions, e.g., array( "$property" => "$value", "$property" => "$value" ).
Default:
array()
Source
File: wp-includes/style-engine/class-wp-style-engine-css-declarations.php. View all references
public function __construct( $declarations = array() ) {
$this->add_declarations( $declarations );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Style_Engine_CSS_Declarations::add_declarations() wp-includes/style-engine/class-wp-style-engine-css-declarations.php | Adds multiple declarations. |
Used By
| Used By | Description |
|---|---|
| WP_Style_Engine_CSS_Rule::add_declarations() wp-includes/style-engine/class-wp-style-engine-css-rule.php | Sets the declarations. |
| WP_Style_Engine::compile_css() wp-includes/style-engine/class-wp-style-engine.php | Returns compiled CSS from css_declarations. |
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_style_engine_css_declarations/__construct