woocommerce_get_product_thumbnail()WC 1.0

Get the product thumbnail, or the placeholder if not set.

Хуки из функции

Возвращает

Строку.

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

woocommerce_get_product_thumbnail( $size, $attr, $placeholder );
$size(строка)
.
По умолчанию: 'woocommerce_thumbnail'
$attr(массив)
Image attributes.
По умолчанию: array()
$placeholder(true|false)
True to return $placeholder if no image is found, or false to return an empty string.
По умолчанию: true

Код woocommerce_get_product_thumbnail() WC 8.7.0

function woocommerce_get_product_thumbnail( $size = 'woocommerce_thumbnail', $attr = array(), $placeholder = true ) {
	global $product;

	if ( ! is_array( $attr ) ) {
		$attr = array();
	}

	if ( ! is_bool( $placeholder ) ) {
		$placeholder = true;
	}

	$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );

	return $product ? $product->get_image( $image_size, $attr, $placeholder ) : '';
}