Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_product_gallery_image_datapublic staticWC 1.0

Get the product gallery image data.

Method of the class: ProductGalleryUtils{}

No Hooks.

Returns

Array. An array of image data for the product gallery.

Usage

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

ProductGalleryUtils::get_product_gallery_image_data() code WC 10.7.0

public static function get_product_gallery_image_data( $product, $size ) {
	$all_image_ids = self::get_all_image_ids( $product );
	return self::get_image_src_data( $all_image_ids, $size, $product->get_title() );
}