Recent

better_search_query_posts_orderbyfilter

better_search_query_posts_orderby

Filters the ORDER BY clause of the Better_Search.

Type: filter
Since: 3.0.0
Source: includes/class-better-search-core-query.php line 1282

Changelog

Version Description
4.2.0 Added $instance parameter.
3.0.0 Introduced.

Parameters

Type Name Description
string $orderby The ORDER BY clause of the query.
\WP_Query $query The WP_Query instance.
Better_Search_Core_Query $instance The Better_Search_Core_Query instance (passed by reference).

Usage

add_filter( 'better_search_query_posts_orderby', function($orderby, $query, $instance) {
    // ...
    return $orderby;
} );