WordPress at Your Fingertips
function is not described

WC_Order::get_address_prop() protected WC 3.0.0

Gets a prop for a getter method.

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

Hooks from the method

Return

Mixed.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_address_prop( $prop, $address, $context );
$prop(string) (required)
Name of prop to get.
$address(string)
billing or shipping.
Default: 'billing'
$context(string)
What the value is for. Valid values are view and edit.
Default: 'view'

Changelog

Since 3.0.0 Introduced.

Code of WC_Order::get_address_prop() WC 5.8.0

protected function get_address_prop( $prop, $address = 'billing', $context = 'view' ) {
	$value = null;

	if ( array_key_exists( $prop, $this->data[ $address ] ) ) {
		$value = isset( $this->changes[ $address ][ $prop ] ) ? $this->changes[ $address ][ $prop ] : $this->data[ $address ][ $prop ];

		if ( 'view' === $context ) {
			$value = apply_filters( $this->get_hook_prefix() . $address . '_' . $prop, $value, $this );
		}
	}
	return $value;
}