Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_product_gallery_image_countpublic staticWC 1.0

Get the product gallery image count.

Method of the class: ProductGalleryUtils{}

No Hooks.

Returns

Int. The number of images in the product gallery.

Usage

$result = ProductGalleryUtils::get_product_gallery_image_count( $product );
$product(WC_Product) (required)
The product object to retrieve the gallery images for.

ProductGalleryUtils::get_product_gallery_image_count() code WC 10.8.1

public static function get_product_gallery_image_count( $product ) {
	$all_image_ids = self::get_all_image_ids( $product );
	return count( $all_image_ids );
}