Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_video_html │ public static │ WC 1.0

Get product gallery video HTML from attributes.

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

Хуков нет.

Возвращает

string. Video HTML.

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

$result = ProductGalleryUtils::get_video_html( $attributes );
$attributes(массив) (обязательный)
Video attributes.

Код ProductGalleryUtils::get_video_html() WC 11.2.2

public static function get_video_html( $attributes ) {
	if ( empty( $attributes ) ) {
		return '';
	}

	return '<video ' . wc_implode_html_attributes(
		array_filter(
			$attributes,
			static function ( $value ) {
				return '' !== $value;
			}
		)
	) . '></video>';
}