woocommerce_order_hold_stock_minutes filter-hookWC 8.8.0

Filters the number of minutes an order should reserve stock for.

This hook allows the number of minutes that stock in an order should be reserved for to be filtered, useful for third party developers to increase/reduce the number of minutes if the order meets certain criteria, or to exclude an order from stock reservation using a zero value.


add_filter( 'woocommerce_order_hold_stock_minutes', 'wp_kama_woocommerce_order_hold_stock_minutes_filter', 10, 2 );

 * Function for `woocommerce_order_hold_stock_minutes` filter-hook.
 * @param int       $minutes How long to reserve stock for the order in minutes.
 * @param \WC_Order $order   Order object.
 * @return int
function wp_kama_woocommerce_order_hold_stock_minutes_filter( $minutes, $order ){

	// filter...
	return $minutes;
How long to reserve stock for the order in minutes.
Default: woocommerce_hold_stock_minutes or 10 if block checkout entry
Order object.


Since 8.8.0 Introduced.

Where the hook is called

woocommerce/src/Checkout/Helpers/ReserveStock.php 80
$minutes = (int) apply_filters( 'woocommerce_order_hold_stock_minutes', $minutes, $order );

Where the hook is used in WooCommerce

Usage not found.