WC_Product_Variation::get_sku()
Get SKU (Stock-keeping unit) - product unique ID.
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_sku( $context );
- $context(string)
- What the value is for. Valid values are view and edit.
Default: 'view'
WC_Product_Variation::get_sku() WC Product Variation::get sku code WC 9.2.3
public function get_sku( $context = 'view' ) { $value = $this->get_prop( 'sku', $context ); // Inherit value from parent. if ( 'view' === $context && empty( $value ) ) { $value = apply_filters( $this->get_hook_prefix() . 'sku', $this->parent_data['sku'], $this ); } return $value; }