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'
Return Return
(string)
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; }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |