woocommerce_update_product_stock_query, $sql, $product_id_with_stock, $stock_quantity, set
woocommerce_update_product_stock_query, $sql, $product_id_with_stock, $stock_quantity, set
Appears in: woocommerce.11.0.0
Hook Type: filter
Displaying hooks found in version: woocommerce.11.0.0apply_filters('woocommerce_update_product_stock_query, $sql, $product_id_with_stock, $stock_quantity, set') is found 1 times:
- /includes/data-stores/class-wc-product-data-store-cpt.php line 1758
number_format( (float) $stock_quantity, WC_ROUNDING_PRECISION, '.', '' ), $product_id_with_stock ); $sql = apply_filters( 'woocommerce_update_product_stock_query', $sql, $product_id_with_stock, $stock_quantity, 'set' ); $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared // Cache delete is required (not only) to set correct data for lookup table (which reads from cache). // Sometimes I wonder if it shouldn't be part of update_lookup_table. wp_cache_delete( $product_id_with_stock, 'post_meta' );