safecss_filter_attr_allow_css хук-фильтрWP 5.5.0

Filters the check for unsafe CSS in safecss_filter_attr.

Enables developers to determine whether a section of CSS should be allowed or discarded. By default, the value will be false if the part contains \ ( & } = or comments. Return true to allow the CSS part to be included in the output.

Использование

add_filter( 'safecss_filter_attr_allow_css', 'wp_kama_safecss_filter_attr_allow_css_filter', 10, 2 );

/**
 * Function for `safecss_filter_attr_allow_css` filter-hook.
 * 
 * @param bool   $allow_css       Whether the CSS in the test string is considered safe.
 * @param string $css_test_string The CSS string to test.
 *
 * @return bool
 */
function wp_kama_safecss_filter_attr_allow_css_filter( $allow_css, $css_test_string ){

	// filter...
	return $allow_css;
}
$allow_css(true|false)
Whether the CSS in the test string is considered safe.
$css_test_string(строка)
The CSS string to test.

Список изменений

С версии 5.5.0 Введена.

Где вызывается хук

safecss_filter_attr()
safecss_filter_attr_allow_css
wp-includes/kses.php 2616
$allow_css = apply_filters( 'safecss_filter_attr_allow_css', $allow_css, $css_test_string );

Где используется хук в WordPress

Использование не найдено.