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

git-svn-id: http://svn.automattic.com/wordpress/trunk@2466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-22 01:55:07 +00:00
parent cfc06de303
commit 1dd96f8a39
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