WordPress – Optimize the Meta Query for 3 meta keys at a time

Conclusion – In my case I tried below When I changed placement of last meta or at the first place worked perfectly. <?php $price_from = ’20’; $price_to = ‘700’; $meta_query_price[] = array( ‘relation’ => ‘OR’, array( ‘key’ => ‘price_type’, ‘value’ => ‘POA’, ‘type’ => ‘value’, ‘compare’ => ‘LIKE’ ), array( ‘relation’ => ‘AND’, array( ‘key’ … Read more

Problem with custom WordPress Rest API search route with query parameters

It isn’t reading the acceptable image type parameter because there is no code to read it, and the acceptable image types have been hardcoded here: array( ‘key’ => ‘accepted_image_type’, ‘value’ => array(‘print’, ‘glass-plate’), ‘compare’ => ‘IN’, ), Much like you did here for the search parameter: $search_query = $data[‘s’]; It needs to do the same … Read more