WP_Theme_JSON::is_safe_css_declaration()
Checks that a declaration provided by the user is safe.
Метод класса: WP_Theme_JSON{}
Хуков нет.
Возвращает
true|false
.
Использование
$result = WP_Theme_JSON::is_safe_css_declaration( $property_name, $property_value );
- $property_name(строка) (обязательный)
- Property name in a CSS declaration, i.e. the color in color: red.
- $property_value(строка) (обязательный)
- Value in a CSS declaration, i.e. the red in color: red.
Список изменений
С версии 5.9.0 | Введена. |
Код WP_Theme_JSON::is_safe_css_declaration() WP Theme JSON::is safe css declaration WP 6.1.1
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 ) ); }