Last active
November 4, 2019 16:30
-
-
Save mikeyarce/c7c75d0f0550f014a0f340fb73267d4e to your computer and use it in GitHub Desktop.
Modify ES query argument for Jetpack Search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'jetpack_search_es_query_args', function( $args, $query ) { | |
$args['date_range'] = array( | |
'field' => 'date', | |
'gte' => '2016-01-01', | |
'lte' => '2016-12-31', | |
); | |
return $args; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment