Automattic\WooCommerce\Internal\ProductGallery

ProductMediaGallery::normalize_video_gallery_items │ public static │ WC 1.0

Normalize video gallery items.

Method of the class: ProductMediaGallery{}

No Hooks.

Returns

array.

Usage

$result = ProductMediaGallery::normalize_video_gallery_items( $video_gallery ): array;
$video_gallery(array) (required)
Video gallery data.

ProductMediaGallery::normalize_video_gallery_items() code WC 11.1.2

public static function normalize_video_gallery_items( array $video_gallery ): array {
	$items = array();

	foreach ( $video_gallery as $fallback_position => $item ) {
		if ( ! is_array( $item ) ) {
			continue;
		}

		$item = self::normalize_video_gallery_item( $item, absint( $fallback_position ) );

		if ( ! empty( $item ) ) {
			$items[] = $item;
		}
	}

	return $items;
}