ACF\Pro\Forms

WC_Order::save_orderpublicACF 6.4

Saves ACF fields to the current order.

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

Хуков нет.

Возвращает

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

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

$WC_Order = new WC_Order();
$WC_Order->save_order( $order_id );
$order_id(int) (обязательный)
The order ID.

Список изменений

С версии 6.4 Введена.

Код WC_Order::save_order() ACF 6.4.2

public function save_order( int $order_id ) {
	// Bail if not using HPOS to prevent a double-save.
	if ( ! $this->is_hpos_enabled() ) {
		return;
	}

	// Remove the action to prevent an infinite loop via $order->save().
	remove_action( 'woocommerce_update_order', array( $this, 'save_order' ), 10 );
	acf_save_post( 'woo_order_' . $order_id );
}