Automattic\WooCommerce\Internal\Utilities

HtmlSanitizer::styled_post_content()publicWC 1.0

Sanitizes a chunk of HTML, by following the same rules as wp_kses_post() also allowing the style element to be supplied.

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

Хуков нет.

Возвращает

Строку.

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

$HtmlSanitizer = new HtmlSanitizer();
$HtmlSanitizer->styled_post_content( $html ): string;
$html(строка) (обязательный)
The HTML to be sanitized.

Код HtmlSanitizer::styled_post_content() WC 9.7.1

public function styled_post_content( string $html ): string {
	$rules          = wp_kses_allowed_html( 'post' );
	$rules['style'] = true;
	return wp_kses( $html, $rules );
}