WC_Order::set_address_prop( string $prop, string $address, mixed $value )

Sets a prop for a setter method.


Description Description


Parameters Parameters

$prop

(Required) Name of prop to set.

$address

(Required) Name of address to set. billing or shipping.

$value

(Required) Value of the prop.


Top ↑

Source Source

File: includes/class-wc-order.php

	protected function set_address_prop( $prop, $address = 'billing', $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;
			}
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.