From fa383969984c391e3d89d84dcf71f3b38fa180af Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 29 May 2014 00:24:14 +0000 Subject: [PATCH] Allow users to sort posts by `type` in `WP_Query`. Props DeBAAT. Fixes #28214. Built from https://develop.svn.wordpress.org/trunk@28605 git-svn-id: http://core.svn.wordpress.org/trunk@28429 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 7216ca0f53..e98f73e790 100644 --- a/wp-includes/query.php +++ b/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';