WP_Style_Engine_CSS_Declarations::filter_declaration()
Filters a CSS property + value pair.
Method of the class: WP_Style_Engine_CSS_Declarations{}
No Hooks.
Return
String
. The filtered declaration or an empty string.
Usage
$result = WP_Style_Engine_CSS_Declarations::filter_declaration( $property, $value, $spacer );
- $property(string) (required)
- The CSS property.
- $value(string) (required)
- The value to be filtered.
- $spacer(string)
- The spacer between the colon and the value.
Default: empty string
Changelog
Since 6.1.0 | Introduced. |
WP_Style_Engine_CSS_Declarations::filter_declaration() WP Style Engine CSS Declarations::filter declaration code WP 6.5.2
protected static function filter_declaration( $property, $value, $spacer = '' ) { $filtered_value = wp_strip_all_tags( $value, true ); if ( '' !== $filtered_value ) { return safecss_filter_attr( "{$property}:{$spacer}{$filtered_value}" ); } return ''; }