Automattic\WooCommerce\Blocks\BlockTypes

FeaturedProduct::get_item_imageprotectedWC 1.0

Returns the featured product image URL.

Method of the class: FeaturedProduct{}

No Hooks.

Returns

string.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_item_image( $product, $size );
$product(WC_Product) (required)
Product object.
$size(string)
Image size.
Default: 'full'

FeaturedProduct::get_item_image() code WC 11.1.1

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

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

	return '';
}