Adds a single declaration.
Parameters
$property
stringrequired- The CSS property.
$value
stringrequired- The CSS value.
Source
public function add_declaration( $property, $value ) {
// Sanitizes the property.
$property = $this->sanitize_property( $property );
// Bails early if the property is empty.
if ( empty( $property ) ) {
return $this;
}
// Trims the value. If empty, bail early.
$value = trim( $value );
if ( '' === $value ) {
return $this;
}
// Adds the declaration property/value pair.
$this->declarations[ $property ] = $value;
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.