Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_product_gallery_image_countpublic staticWC 1.0

Get the product gallery image count.

Метод класса: ProductGalleryUtils{}

Хуков нет.

Возвращает

int. The number of images in the product gallery.

Использование

$result = ProductGalleryUtils::get_product_gallery_image_count( $product );
$product(WC_Product) (обязательный)
The product object to retrieve the gallery images for.

Код ProductGalleryUtils::get_product_gallery_image_count() WC 11.0.0

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