Automattic\WooCommerce\Blocks\Utils

ProductGalleryUtils::get_image_src_data │ public static │ WC 1.0

Get the image source data.

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

Хуков нет.

Возвращает

array. An array of image source data.

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

$result = ProductGalleryUtils::get_image_src_data( $image_ids, $size, $product_title );
$image_ids(массив) (обязательный)
The image IDs to retrieve the source data for.
$size(строка) (обязательный)
The size of the image to retrieve.
$product_title(строка)
The title of the product used for alt fallback.
По умолчанию: ''

Код ProductGalleryUtils::get_image_src_data() WC 11.2.2

public static function get_image_src_data( $image_ids, $size, $product_title = '' ) {
	$image_src_data = array();

	foreach ( $image_ids as $index => $image_id ) {
		$image_src_data[] = self::get_image_data( $image_id, $size, $product_title, $index );
	}

	return $image_src_data;
}