WC_Product_Variation::get_width( string $context = 'view' )
Returns the product width.
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_width( $context = 'view' ) {
$value = $this->get_prop( 'width', $context );
// Inherit value from parent.
if ( 'view' === $context && empty( $value ) ) {
$value = apply_filters( $this->get_hook_prefix() . 'width', $this->parent_data['width'], $this );
}
return $value;
}