diff --git a/src/StoreApi/Utilities/ProductQueryFilters.php b/src/StoreApi/Utilities/ProductQueryFilters.php index 4d445637135..249e872a7f0 100644 --- a/src/StoreApi/Utilities/ProductQueryFilters.php +++ b/src/StoreApi/Utilities/ProductQueryFilters.php @@ -56,7 +56,7 @@ public function get_filtered_price( $request ) { public function get_stock_status_counts( $request ) { global $wpdb; $product_query = new ProductQuery(); - $stock_status_options = array( 'instock', 'outofstock', 'onbackorder' ); + $stock_status_options = array_map( 'esc_sql', array_keys( wc_get_product_stock_status_options() ) ); $hide_outofstock_items = get_option( 'woocommerce_hide_out_of_stock_items' ); if ( 'yes' === $hide_outofstock_items ) { unset( $stock_status_options['outofstock'] );