posts_orderby filter-hookWP 1.5.1

Filters the ORDER BY clause of the query.

Usage

add_filter( 'posts_orderby', 'wp_kama_posts_orderby_filter' );

/**
 * Function for `posts_orderby` filter-hook.
 * 
 * @param string $orderby The ORDER BY clause of the query.
 *
 * @return string
 */
function wp_kama_posts_orderby_filter( $orderby ){

	// filter...
	return $orderby;
}
$orderby(string)
The ORDER BY clause of the query.

Changelog

Since 1.5.1 Introduced.

Where the hook is called

WP_Query::get_posts()
posts_orderby
wp-includes/class-wp-query.php 2848
$orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) );

Where the hook is used in WordPress

Usage not found.