WordPress at Your Fingertips
function is not described

WC_Order::set_address_prop() protected WC 3.0.0

Sets a prop for a setter method.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_address_prop( $prop, $address, $value );
$prop(string) (required)
Name of prop to set.
$address(string) (required)
Name of address to set. billing or shipping.
$value(mixed) (required)
Value of the prop.

Changelog

Since 3.0.0 Introduced.

Code of WC_Order::set_address_prop() WC 5.6.0

protected function set_address_prop( $prop, $address, $value ) {
	if ( array_key_exists( $prop, $this->data[ $address ] ) ) {
		if ( true === $this->object_read ) {
			if ( $value !== $this->data[ $address ][ $prop ] || ( isset( $this->changes[ $address ] ) && array_key_exists( $prop, $this->changes[ $address ] ) ) ) {
				$this->changes[ $address ][ $prop ] = $value;
			}
		} else {
			$this->data[ $address ][ $prop ] = $value;
		}
	}
}