mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user