Checks that a declaration provided by the user is safe.
Parameters
$property_namestringrequired- Property name in a CSS declaration, i.e. the
colorincolor: red. $property_valuestringrequired- Value in a CSS declaration, i.e. the
redincolor: red.
Source
protected static function is_safe_css_declaration( $property_name, $property_value ) {
$style_to_validate = $property_name . ': ' . $property_value;
$filtered = esc_html( safecss_filter_attr( $style_to_validate ) );
return ! empty( trim( $filtered ) );
}
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.