WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

CartShippingRateSchema::get_rate_prop() protected WC 1.0

Gets a prop of the rate object, if callable.

{} It's a method of the class: CartShippingRateSchema{}

No Hooks.

Return

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.

Code of CartShippingRateSchema::get_rate_prop() WC 5.7.1

protected function get_rate_prop( $rate, $prop ) {
	$getter = 'get_' . $prop;
	return \is_callable( array( $rate, $getter ) ) ? $rate->$getter() : '';
}