Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_video_html │ public static │ WC 1.0

Get product gallery video HTML from attributes.

Method of the class: ProductGalleryUtils{}

No Hooks.

Returns

string. Video HTML.

Usage

$result = ProductGalleryUtils::get_video_html( $attributes );
$attributes(array) (required)
Video attributes.

ProductGalleryUtils::get_video_html() code 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>';
}