Automattic\WooCommerce\Internal\RestApi\Routes\V4\Orders
UpdateUtils::update_address
Update address.
Method of the class: UpdateUtils{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->update_address( $order, $type, $request_data );
- $order(WC_Order) (required)
- Order data.
- $type(string) (required)
- Type of address; 'billing' or 'shipping'.
- $request_data(array) (required)
- Posted data.
UpdateUtils::update_address() UpdateUtils::update address code WC 10.4.3
protected function update_address( WC_Order $order, string $type, array $request_data ) {
foreach ( $request_data as $key => $value ) {
if ( is_callable( array( $order, "set_{$type}_{$key}" ) ) ) {
$order->{"set_{$type}_{$key}"}( $value );
}
}
}