meta_query with more than 9 arrays? (2 posts)

  1. deydod
    Posted 4 years ago #


    I've got very strange problem using meta_query. It works fine until you select more than 9 checkboxes on the search.
    My code is like this for each field:
    if ($_POST['gym'] == '1') {
    $metas[] = array(
    'key' => 'qit_gym',
    'value' => serialize(strval($_POST['gym'])),
    'compare' => 'LIKE'

    Where $metas[] is my array for all checkboxes. Then create the query with the other variables:
    $totalquery = array(
    'types' => $s_type,
    'locations' => $s_location,
    'post_type' => 'estates',
    'posts_per_page' => $per_page,
    'meta_query' => $metas
    $search_query = new WP_Query($totalquery);

    Tested on WP 3.2 and 3.3 -> not working.

    Does anybody knows if there is particular limitation or it is a bug?

  2. Ken Dirschl
    Posted 3 years ago #

    I've come up against the same problem using WP_User_Query; up to 9 meta queries returns in less than two seconds; 10 queries and the process just runs and runs (I've let it go as long as ten minutes). On my localhost it crashes the server, and maxes out CPU. On the live server it just keeps running until I kill it.

Topic Closed

This topic has been closed to new replies.

About this Topic