WC_REST_Orders_V2_Controller::update_address
Update address.
Метод класса: WC_REST_Orders_V2_Controller{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->update_address( $order, $posted, $type );
- $order(WC_Order) (обязательный)
- Order data.
- $posted(массив) (обязательный)
- Posted data.
- $type(строка)
- Type of address; 'billing' or 'shipping'.
По умолчанию: 'billing'
Код WC_REST_Orders_V2_Controller::update_address() WC REST Orders V2 Controller::update address WC 10.3.4
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 );
}
}
}