WC_REST_Orders_V1_Controller::update_address()protectedWC 1.0

Update address.

Метод класса: WC_REST_Orders_V1_Controller{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->update_address( $order, $posted, $type );
$order(WC_Order) (обязательный)
Order object.
$posted(массив) (обязательный)
Request data.
$type(строка)
Type of address; 'billing' or 'shipping'.
По умолчанию: 'billing'

Код WC_REST_Orders_V1_Controller::update_address() WC 8.7.0

protected function update_address( $order, $posted, $type = 'billing' ) {
	foreach ( $posted as $key => $value ) {
		if ( is_callable( array( $order, "set_{$type}_{$key}" ) ) ) {
			$order->{"set_{$type}_{$key}"}( $value );
		}
	}
}