posts_search_orderby WordPress Filter Hook
The posts_search_orderby hook is used to alter the search SQL ORDER BY clause for the search results. This hook can be used to sort search results by relevance, date, title, or any other custom field.
apply_filters( 'posts_search_orderby', string $search_orderby , WP_Query $query ) #
Filters the ORDER BY used when ordering search results.
Parameters
Source
Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |