Home › Forums › General Issues › WP_Query … condition statements … now getting trim errors… › Reply To: WP_Query … condition statements … now getting trim errors…
The two trim errors are coming up when the two keys are involved (banner_cats and banner_towns). So, if I remove one of those arrays from the query, only one trim error occurs. Both of those keys are multi select fields in acf.
When I print the $pagecategories array (to check it), I get…
Array (  => 1 )
When I print $currenttowns array, I get…
Array (  => 1  => 3215 )
So, I have one array (i.e. $currenttowns) comparing to the select field array (i.e. banner_towns) … can I not do that? I need to see if any of the fields in the arrays match, if so, then the query should call that post.
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.