wp-includes/style-engine/class-wp-style-engine-css-declarations.php:69Adds a single declaration.
$propertystring$valuestring$optionsarrayoptionalarray()$importantbooldefault: false
WP_Style_Engine_CSS_Declarations public function add_declaration( $property, $value, $options = array() ) { // Sanitizes the property. $property = $this->sanitize_property( $property ); // Bails early if the property is empty. if ( empty( $property ) ) { return $this; } // Bail early if value is not a string. Prevents fatal errors from malformed block markup. if ( ! is_string( $value ) ) { return $this; } // Trims the value. If empty, bail early. $value = trim( $value ); if ( '' === $value ) { return $this; } $options = wp_parse_args( $options, array( 'important' => false, ) ); $options = array_filter( $options ); // Adds the declaration property/value pair. $this->declarations[ $property ] = $value; if ( $options ) { $this->declaration_options[ $property ] = $options; } else { unset( $this->declaration_options[ $property ] ); } return $this; }Introduced in 6.1.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$options added.verified against sourcesrc/wp-includes/style-engine/class-wp-style-engine-css-declarations.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.