Automattic\WooCommerce\Internal\Caches

OrdersVersionStringInvalidator::handle_woocommerce_order_status_changedpublicWC 10.6.0

Handle the woocommerce_order_status_changed hook.

Status changes affect which orders appear in status-filtered collection endpoints, so we always invalidate the orders list.

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

Хуков нет.

Возвращает

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

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

$OrdersVersionStringInvalidator = new OrdersVersionStringInvalidator();
$OrdersVersionStringInvalidator->handle_woocommerce_order_status_changed( $order_id, $from_status, $to_status, $order ): void;
$order_id(int) (обязательный)
The order ID.
$from_status(строка) (обязательный)
The old status.
$to_status(строка) (обязательный)
The new status.
$order(WC_Order) (обязательный)
The order object.

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

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

Код OrdersVersionStringInvalidator::handle_woocommerce_order_status_changed() WC 11.0.1

public function handle_woocommerce_order_status_changed( $order_id, $from_status, $to_status, $order ): void {
	$this->invalidate( (int) $order_id );
	$this->invalidate_orders_list();
}