Sets the declarations.
Parameters
$declarations
string[]|WP_Style_Engine_CSS_Declarationsrequired- An array of declarations (property => value pairs), or a WP_Style_Engine_CSS_Declarations object.
Source
public function add_declarations( $declarations ) {
$is_declarations_object = ! is_array( $declarations );
$declarations_array = $is_declarations_object ? $declarations->get_declarations() : $declarations;
if ( null === $this->declarations ) {
if ( $is_declarations_object ) {
$this->declarations = $declarations;
return $this;
}
$this->declarations = new WP_Style_Engine_CSS_Declarations( $declarations_array );
}
$this->declarations->add_declarations( $declarations_array );
return $this;
}
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.