WP_Style_Engine_CSS_Declarations::filter_declaration()protected staticWP 6.1.0

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() code WP 6.6

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 '';
}