WC_Product_Variation::get_length PHP Method

get_length() public method

Returns the product length.
public get_length ( string $context = 'view' ) : string
$context string
return string
    public function get_length($context = 'view')
    {
        $value = $this->get_prop('length', $context);
        // Inherit value from parent.
        if ('view' === $context && empty($value)) {
            $value = $this->parent_data['length'];
        }
        return $value;
    }