• Resolved prateekshawebdesign

    (@prateekshawebdesign)


    Wp-Property –

    I have postmeta tags saved in each property. the key is “datesavailable” and values are an array of dates. How do I add a meta_query to query the search?

    There is a filter called “parse_request” and i am adding my code to that filter
    but it does not work

    function my_parse_request(&$query)
    {
    $query->query_vars[‘meta_query’][] = [
    ‘key’ => ‘datesavailable’,
    ‘value’ => date(‘d-m-Y’),
    ‘compare’ => ‘BETWEEN’
    ];

    return $query;

    }

    Can anybody help?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Wp-Property – How do I add a meta_query to query in “parse_request” function?’ is closed to new replies.