WC_Shipping_Rate::__get()publicWC 3.2.0

Magic methods to support direct access to props.

Method of the class: WC_Shipping_Rate{}

No Hooks.

Return

Mixed.

Usage

$WC_Shipping_Rate = new WC_Shipping_Rate();
$WC_Shipping_Rate->__get( $key );
$key(string) (required)
Key.

Changelog

Since 3.2.0 Introduced.

WC_Shipping_Rate::__get() code WC 8.7.0

public function __get( $key ) {
	if ( is_callable( array( $this, "get_{$key}" ) ) ) {
		return $this->{"get_{$key}"}();
	} elseif ( isset( $this->data[ $key ] ) ) {
		return $this->data[ $key ];
	} else {
		return '';
	}
}