Home › Forums › General Issues › WP_Query … condition statements … now getting trim errors… › Reply To: WP_Query … condition statements … now getting trim errors…
This is extremely odd, when you try to use “IN” WP does not detect that there is an array stored in the field, it’s looking for multiple meta value rows in the database. When you attempt to have WP treat it as a string with “LIKE” it then decides to detect that there is an array (serialized) stored in the field.
WP has been doing some work on the meta queries to allow for the new clauses for meta_query https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/
Try forcing the field type to “CHAR”
array( 'key' => 'banner_cats', 'value' => $pagecategories, 'compare' => 'LIKE', 'type' => 'CHAR', ),
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.