1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//check if the request contains arrays. 
//If yes, implode them to strings with coma (OR operator)
function yclads_qmt_parse_request($request) {
  //TO FIX LIMIT TO SPECIFIC QUERIES

  $request_args = $request->query_vars;
  foreach($request_args as $arg_key=>$arg_value) {
    if (!is_array($arg_value)) continue;
    $request_args[$arg_key]=implode(',',$arg_value); //'OR' operator
  }

  $request->query_vars = $request_args;

  return $request;
}

add_action('parse_request','yclads_qmt_parse_request');