Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Image::cleanup_image_html │ private │ WC 1.0

Cleanup image HTML.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->cleanup_image_html( $content_html ): string;
$content_html(строка) (обязательный)
Content HTML.

Код Image::cleanup_image_html() WC 11.2.2

private function cleanup_image_html( string $content_html ): string {
	$html = new \WP_HTML_Tag_Processor( $content_html );
	if ( $html->next_tag( array( 'tag_name' => 'img' ) ) ) {
		$html->remove_attribute( 'srcset' );
		$html->remove_attribute( 'class' );
	}
	return $html->get_updated_html();
}