WC_Product_Variation::get_manage_stock( string $context = 'view' )
Return if product manage stock.
Description Description
Parameters Parameters
- $context
-
(Optional) What the value is for. Valid values are view and edit.
Default value: 'view'
Return Return
(boolean|string) true, false, or parent.
Source Source
File: includes/class-wc-product-variation.php
public function get_manage_stock( $context = 'view' ) {
$value = $this->get_prop( 'manage_stock', $context );
// Inherit value from parent.
if ( 'view' === $context && false === $value && true === wc_string_to_bool( $this->parent_data['manage_stock'] ) ) {
$value = 'parent';
}
return $value;
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |