Automattic\WooCommerce\StoreApi\Schemas\V1
CartShippingRateSchema::get_rate_prop
Gets a prop of the rate object, if callable.
Method of the class: CartShippingRateSchema{}
No Hooks.
Returns
String.
Usage
// protected - for code of main (parent) or child class $result = $this->get_rate_prop( $rate, $prop );
- $rate(WC_Shipping_Rate) (required)
- Rate object.
- $prop(string) (required)
- Prop name.
CartShippingRateSchema::get_rate_prop() CartShippingRateSchema::get rate prop code WC 10.5.0
protected function get_rate_prop( $rate, $prop ) {
$getter = 'get_' . $prop;
return \is_callable( array( $rate, $getter ) ) ? $rate->$getter() : '';
}