Add posts_orderby filter. http://mosquito.wordpress.org/view.php?id=1149 Props: davidchait

git-svn-id: https://develop.svn.wordpress.org/trunk@2466 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-03-22 01:55:07 +00:00
parent b82bbcce7b
commit f4e023b68a
1 changed files with 3 additions and 1 deletions

View File

@ -537,7 +537,9 @@ class WP_Query {
$where = apply_filters('posts_where_paged', $where);
$where .= " GROUP BY $wpdb->posts.ID";
$join = apply_filters('posts_join_paged', $join);
$request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1".$where." ORDER BY post_" . $q['orderby'] . " $limits";
$orderby = "post_" . $q['orderby'];
$orderby = apply_filters('posts_orderby', $orderby);
$request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1".$where." ORDER BY " . $orderby . " $limits";
if ($q['preview']) {
$request = 'SELECT 1-1'; // dummy mysql query for the preview