woocommerce_query_for_reserved_stock хук-фильтрWC 4.5.0

Filter: woocommerce_query_for_reserved_stock Allows to filter the query for getting reserved stock of a product.

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

add_filter( 'woocommerce_query_for_reserved_stock', 'wp_kama_woocommerce_query_for_reserved_stock_filter', 10, 3 );

/**
 * Function for `woocommerce_query_for_reserved_stock` filter-hook.
 * 
 * @param string $query            The query for getting reserved stock of a product.
 * @param int    $product_id       Product ID.
 * @param int    $exclude_order_id Order to exclude from the results.
 *
 * @return string
 */
function wp_kama_woocommerce_query_for_reserved_stock_filter( $query, $product_id, $exclude_order_id ){

	// filter...
	return $query;
}
$query(строка)
The query for getting reserved stock of a product.
$product_id(int)
Product ID.
$exclude_order_id(int)
Order to exclude from the results.

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

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

Где вызывается хук

ReserveStock::get_query_for_reserved_stock()
woocommerce_query_for_reserved_stock
woocommerce/src/Checkout/Helpers/ReserveStock.php 267
return apply_filters( 'woocommerce_query_for_reserved_stock', $query, $product_id, $exclude_order_id );

Где используется хук в WooCommerce

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