Automattic\WooCommerce\Internal\Caches

OrdersVersionStringInvalidator::invalidate_order_refunds_listprivateWC 1.0

Invalidate the refunds list version string for a specific order.

This should be called when refunds are created or deleted for an order, as these operations affect the /orders/{id}/refunds collection endpoint.

Method of the class: OrdersVersionStringInvalidator{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->invalidate_order_refunds_list( $order_id ): void;
$order_id(int) (required)
The parent order ID.

OrdersVersionStringInvalidator::invalidate_order_refunds_list() code WC 10.7.0

private function invalidate_order_refunds_list( int $order_id ): void {
	if ( $order_id > 0 ) {
		wc_get_container()->get( VersionStringGenerator::class )->delete_version( "list_order_refunds_{$order_id}" );
	}
}