WordPress at Your Fingertips
function is not described

WC_Product_Variation::get_image_id() public WC 3.0.0

Get main image ID.

{} It's a method of the class: WC_Product_Variation{}

Hooks from the method
Return

String.

Usage

$WC_Product_Variation = new WC_Product_Variation();
$WC_Product_Variation->get_image_id( $context );
$context(string)
What the value is for. Valid values are view and edit.
Default: 'view'

Changelog

Since 3.0.0 Introduced.

Code of WC_Product_Variation::get_image_id() WC 5.6.0

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;
}