WC_Helper_Sanitization::sanitize_htmlpublic staticWC 1.0

Sanitize HTML content allowing a subset of SVG elements.

Метод класса: WC_Helper_Sanitization{}

Хуков нет.

Возвращает

Строку. Sanitized HTML with SVG support.

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

$result = WC_Helper_Sanitization::sanitize_html( $html );
$html(строка) (обязательный)
The HTML to sanitize.

Код WC_Helper_Sanitization::sanitize_html() WC 11.0.0

public static function sanitize_html( $html ) {
	$allowed_html = wp_kses_allowed_html( 'post' );

	// Selected SVG tags and attributes.
	$svg_tags     = self::wc_kses_safe_svg_tags();
	$allowed_html = array_merge( $allowed_html, $svg_tags );

	return wp_kses( self::wc_pre_sanitize_svg( $html ), $allowed_html );
}