woocommerce_update_product_stock_query

woocommerce_update_product_stock_query

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.7.1

apply_filters('woocommerce_update_product_stock_query') is found 2 times:

  • /includes/data-stores/class-wc-product-data-store-cpt.php line 1641
    1637
    1638
    1639
    1640
    1641
    1642
    1643
    1644
    1645
    1646
    1647
        $stock_quantity,
        $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' );
  • /includes/data-stores/class-wc-product-data-store-cpt.php line 1710
    1706
    1707
    1708
    1709
    1710
    1711
    1712
    1713
    1714
    1715
    1716
            $product_id_with_stock
        );
    }
     
    $sql = apply_filters( 'woocommerce_update_product_stock_query', $sql, $product_id_with_stock, $new_stock, $operation );
     
    $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' );