Home › Forums › Bug Reports › The WP 4.8.3 update broke the query on sub field values › Reply To: The WP 4.8.3 update broke the query on sub field values
Inspecting the $the_query I noticed a difference on the select. Previously was something like this:
cnfn_postmeta.meta_key = \'locations_%_city\'
but now it looks like:
cnfn_postmeta.meta_key = \'locations_{f12d517a894ce203cd99a63423903c99584233ad4535dc2d10f20cb2029ad0e7}_city\'
So… removing the % on the filter I fixed the bug (that means now $the_query->have_posts() returns posts) but I’m not sure is a real fix.
old code:
$where = str_replace("meta_key = 'locations_%", "meta_key LIKE 'locations_%", $where);
new code:
$where = str_replace("meta_key = 'locations_", "meta_key LIKE 'locations_", $where);
Please, someone more expert can confirm if it’s correct?
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.