Skip to content

Instantly share code, notes, and snippets.

@mikeyarce
Last active November 4, 2019 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyarce/c7c75d0f0550f014a0f340fb73267d4e to your computer and use it in GitHub Desktop.
Save mikeyarce/c7c75d0f0550f014a0f340fb73267d4e to your computer and use it in GitHub Desktop.
Modify ES query argument for Jetpack Search
<?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