WP_Style_Engine_CSS_Declarations::add_declaration() – Adds a single declaration.
You appear to be a bot. Output may be restricted
Description
Adds a single declaration.
Usage
$WP_Style_Engine_CSS_Declarations = WP_Style_Engine_CSS_Declarations::add_declaration( $property, $value );
Parameters
- $property
- ( string ) required – The CSS property.
- $value
- ( string ) required – The CSS value.
Returns
WP_Style_Engine_CSS_Declarations Returns the object to allow chaining methods.
Source
File name: wordpress/wp-includes/style-engine/class-wp-style-engine-css-declarations.php
Lines:
1 to 20 of 20
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; }