woocommerce_update_product_stock_query
Usage
add_filter( 'woocommerce_update_product_stock_query', 'wp_kama_woocommerce_update_product_stock_query_filter', 10, 4 ); /** * Function for `woocommerce_update_product_stock_query` filter-hook. * * @param $sql * @param $product_id_with_stock * @param $stock_quantity * @param $string * * @return */ function wp_kama_woocommerce_update_product_stock_query_filter( $sql, $product_id_with_stock, $stock_quantity, $string ){ // filter... return $sql; }
- $sql
- -
- $product_id_with_stock
- -
- $stock_quantity
- -
- $string
- -
Where the hook is called
woocommerce_update_product_stock_query
woocommerce_update_product_stock_query
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 1553
$sql = apply_filters( 'woocommerce_update_product_stock_query', $sql, $product_id_with_stock, $stock_quantity, 'set' );
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 1622
$sql = apply_filters( 'woocommerce_update_product_stock_query', $sql, $product_id_with_stock, $new_stock, $operation );