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 use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.