Title: array_filter() expects parameter 1 to be array
Last modified: April 24, 2023

---

# array_filter() expects parameter 1 to be array

 *  Resolved [andybds](https://wordpress.org/support/users/andybds/)
 * (@andybds)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/array_filter-expects-parameter-1-to-be-array-2/)
 * Parameter 1 is meta_query and is reporting to be null.
 * What causes that and how do I trace it back to the actual query that is sending
   a null query?
 * this is meaning that the basket is failing at random and is always empty as you
   will see (for now) it shows a random string at the top of the basket but no way
   to tell where that is from. basket is always empty even when things have been
   placed in it.
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Farray_filter-expects-parameter-1-to-be-array-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Ahir Hemant](https://wordpress.org/support/users/hemant-ahir/)
 * (@hemant-ahir)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/array_filter-expects-parameter-1-to-be-array-2/#post-16682694)
 * For some reason, sometimes you add products to cart but the cart page stays empty(
   even if you can clearly see the cart widget has products in it for example).
   
   But don’t worry – it may just be a simple cache issue (and if you don’t know 
   what cache is that’s no problem either) or a theme / plugin “conflict”.The WooCommerce
   Cart page is extremely delicate; it displays dynamic content based on cookies
   and PHP sessions, is coded with PHP but also JS and Ajax, requires to be excluded
   from cache and is subject to problems in case of out of date software.
 * Fix 0. Update WordPress & WooCommerce
   Fix 1. Think about what you changed before
   the error occurredFix 2. Temporary disable all plugins except WooCommerceFix 
   3. Temporarily switch to 2020 theme (or similar)Fix 4. Make sure Theme, WooCommerce&
   WordPress are using “compatible” versionsFix 5. Make sure there is no “red font
   alert” under WooCommerce > StatusFix 6. WooCommerce > Status > ToolsMostly the“
   Clear customer sessions” one can usually help you troubleshoot Cart problems (
   as well as shipping calculations issues, just so you know).Fix 7. Save (flush)
   your permalinksThanks
 * Ahir
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/array_filter-expects-parameter-1-to-be-array-2/#post-16683995)
 * Hi [@andybds](https://wordpress.org/support/users/andybds/)
 * Thanks for reaching out!
 * I understand that you are seeing a random text string on your cart page and even
   though a product was added to the cart, the cart is still showing an empty basket,
   correct?
 * Checking your site, I can confirm the issues as you can see below:
 * ![](https://i0.wp.com/snipboard.io/KomOaq.jpg?ssl=1)
 * For us to investigate this further, can you please try to switch to the [default Storefront theme](https://woocommerce.com/storefront/)
   and only WooCommerce plugin is enabled, add a product to your cart and see if
   the product was added and the text string is already not visible in the cart 
   page.
 * If so, then this kind of problem is usually caused by your theme or a third-party
   plugin present on your site. We can run a conflict test to verify this. I’d recommend
   cloning your site to a staging environment and performing the tests described
   on this [guide](https://woocommerce.com/document/how-to-test-for-conflicts/) 
   without modifying your live site or impacting customers. Many hosts provide staging
   facilities, so it’s worth checking in with them. It’s also possible to do it 
   using the free [WP Staging](https://wordpress.org/plugins/wp-staging/) plugin.
 * If this was caused by a third-party plugin present on your site, it would be 
   best to reach out to the developers for further assistance here.
 * If this did not resolve the issue, please share your **System Status Report**,
   that will help us further troubleshoot.
 * You can find it via `WooCommerce > Status`. Select `Get system report` and then`
   Copy for support`. Once you’ve done that, you can paste it into your reply here.
 * If you could also provide the **fatal error logs** (if any) under `WooCommerce
   > Status > Logs`.
 * You could copy and paste your reply here or paste it via [https://gist.github.com/](https://gist.github.com/)
   and send the link here.
 * Let us know how it goes!
 *  Thread Starter [andybds](https://wordpress.org/support/users/andybds/)
 * (@andybds)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/array_filter-expects-parameter-1-to-be-array-2/#post-16684744)
 * Thanks – clearing customer sessions seemed to work for a while but then back.
   Seems to now be generally affecting non-logged in users. Currently checking staging
   site to see if we can get the string to disappear.
 * String at top of page isn’t random btw – it’s always the same for every machine
   and user. Just not sure what is outputting it.
 *  [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * (@xue28)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/array_filter-expects-parameter-1-to-be-array-2/#post-16687783)
 * Hi [@andybds](https://wordpress.org/support/users/andybds/)
 * Thanks for sharing further information about your issue.
 * You could also try the suggestions I mentioned above on your staging site for
   us to check if this issue is being caused by your theme or another third-party
   plugin present on your site.
 * Let us know how that goes!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘array_filter() expects parameter 1 to be array’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [meta_query](https://wordpress.org/support/topic-tag/meta_query/)

 * 4 replies
 * 3 participants
 * Last reply from: [xue28 (woo-hc)](https://wordpress.org/support/users/xue28/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/array_filter-expects-parameter-1-to-be-array-2/#post-16687783)
 * Status: resolved