Support

Account

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?