posts_orderby_request
Filters the ORDER BY clause of the query.
For use by caching plugins.
Usage
add_filter( 'posts_orderby_request', 'wp_kama_posts_orderby_request_filter' ); /** * Function for `posts_orderby_request` filter-hook. * * @param string $orderby The ORDER BY clause of the query. * * @return string */ function wp_kama_posts_orderby_request_filter( $orderby ){ // filter... return $orderby; }
- $orderby(string)
- The ORDER BY clause of the query.
Changelog
Since 2.5.0 | Introduced. |
Where the hook is called
posts_orderby_request
wp-includes/class-wp-query.php 3090
$orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) );