Automattic\WooCommerce\Blocks\BlockTypes

FeaturedCategory::get_item_image │ protected │ WC 1.0

Returns the featured category image URL.

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

Хуков нет.

Возвращает

string.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_item_image( $category, $size );
$category(WP_Term) (обязательный)
Term object.
$size(строка)
Image size.
По умолчанию: 'full'

Код FeaturedCategory::get_item_image() WC 11.1.2

protected function get_item_image( $category, $size = 'full' ) {
	$image_id = $this->get_item_image_id( $category );

	if ( $image_id ) {
		return wp_get_attachment_image_url( $image_id, $size );
	}

	return '';
}