posts_orderby filter-hook . WP 1.5.1
Filters the ORDER BY clause of the query.
Usage
add_filter( 'posts_orderby', 'filter_function_name_9826', 10, 2 ); function filter_function_name_9826( $orderby, $this ){ // filter... return $orderby; }
- $orderby(string)
- The ORDER BY clause of the query.
- $this(WP_Query)
- The WP_Query instance (passed by reference).
Changelog
Since 1.5.1 | Introduced. |
Where the hook is called
posts_orderby
wp-includes/class-wp-query.php 2730
$orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) );