Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_product_gallery_media_data │ public static │ WC 1.0

Get the product gallery media data.

Method of the class: ProductGalleryUtils{}

No Hooks.

Returns

array[]. An array of media data for the product gallery.

Usage

$result = ProductGalleryUtils::get_product_gallery_media_data( $product, $size );
$product(WC_Product) (required)
The product object to retrieve the gallery media for.
$size(string) (required)
The size of the poster/image to retrieve.

ProductGalleryUtils::get_product_gallery_media_data() code WC 11.1.2

public static function get_product_gallery_media_data( $product, $size ) {
	$media_items = self::get_all_media_items( $product );
	return self::get_media_src_data( $media_items, $size, $product->get_title() );
}