Skip to content

Commit

Permalink
Merge branch 'develop' into feature/facet-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia authored Sep 24, 2021
2 parents 4b38f69 + 4f3f19e commit 005bf64
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions includes/classes/Indexable/Post/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,14 +837,26 @@ public function format_args( $args, $wp_query ) {
);

/**
* Filter default post query order by
* Filter the ES query order (`sort` clause)
*
* @hook ep_set_default_sort
* @param {string} $sort Default sort
* This filter is used in searches if `orderby` is not set in the WP_Query args.
* The default value is:
*
* $default_sort = array(
* array(
* '_score' => array(
* 'order' => $order,
* ),
* ),
* );
*
* @hook ep_set_sort
* @since 3.6.3
* @param {array} $sort Default sort.
* @param {string} $order Order direction
* @return {string} New default
* @return {array} New default
*/
$default_sort = apply_filters( 'ep_set_default_sort', $default_sort, $order );
$default_sort = apply_filters( 'ep_set_sort', $default_sort, $order );

$formatted_args['sort'] = $default_sort;
}
Expand Down

0 comments on commit 005bf64

Please sign in to comment.