Automattic\WooCommerce\Internal\Admin\Orders

Edit::handle_order_update()publicWC 1.0

Takes care of updating order data. Fires action that metaboxes can hook to for order data updating.

{} Это метод класса: Edit{}

Хуки из метода

Возвращает

null. Ничего.

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

$Edit = new Edit();
$Edit->handle_order_update();

Код Edit::handle_order_update() WC 6.9.4

public function handle_order_update() {
	global $theorder;
	if ( ! isset( $this->order ) ) {
		return;
	}

	if ( 'edit_order' !== sanitize_text_field( wp_unslash( $_POST['action'] ?? '' ) ) ) {
		return;
	}

	check_admin_referer( $this->get_order_edit_nonce_action() );

	/**
	 * Save meta for shop order.
	 *
	 * @param int Order ID.
	 * @param \WC_Order Post object.
	 *
	 * @since 2.1.0
	 */
	do_action( 'woocommerce_process_shop_order_meta', $this->order->get_id(), $this->order );

	// Refresh the order from DB.
	$this->order = wc_get_order( $this->order->get_id() );
	$theorder    = $this->order;
}