WC_Product_Variation::get_image_id( string $context = 'view' )

Get main image ID.


Description Description


Parameters Parameters

$context

(Optional) What the value is for. Valid values are view and edit.

Default value: 'view'


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-wc-product-variation.php

	public function get_image_id( $context = 'view' ) {
		$image_id = $this->get_prop( 'image_id', $context );

		if ( 'view' === $context && ! $image_id ) {
			$image_id = apply_filters( $this->get_hook_prefix() . 'image_id', $this->parent_data['image_id'], $this );
		}

		return $image_id;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.