WC_Product_Variation::get_weight
Returns the product's weight.
Метод класса: WC_Product_Variation{}
Хуки из метода
Возвращает
Строку.
Использование
$WC_Product_Variation = new WC_Product_Variation(); $WC_Product_Variation->get_weight( $context );
- $context(строка)
- What the value is for. Valid values are view and edit.
По умолчанию:'view'
Код WC_Product_Variation::get_weight() WC Product Variation::get weight WC 10.9.1
public function get_weight( $context = 'view' ) {
$value = $this->get_prop( 'weight', $context );
// Inherit value from parent.
if ( 'view' === $context && empty( $value ) ) {
$value = apply_filters( $this->get_hook_prefix() . 'weight', $this->parent_data['weight'], $this );
}
return $value;
}