From 32893ac7ea421ec503d8b7566cd0c71d6aa92d9a Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 29 May 2014 00:23:45 +0000 Subject: [PATCH] Allow users to sort posts by `type` in `WP_Query`. Props DeBAAT. Fixes #28214. git-svn-id: https://develop.svn.wordpress.org/trunk@28605 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index 7216ca0f53..e98f73e790 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -2622,7 +2622,7 @@ class WP_Query { $orderby = "FIELD( {$wpdb->posts}.post_parent, $post_parent__in )"; } else { // Used to filter values - $allowed_keys = array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count'); + $allowed_keys = array( 'name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count', 'type' ); if ( !empty($q['meta_key']) ) { $allowed_keys[] = $q['meta_key']; $allowed_keys[] = 'meta_value';