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
This commit is contained in:
Scott Taylor 2014-05-29 00:23:45 +00:00
parent 0af37cccdb
commit 32893ac7ea
1 changed files with 1 additions and 1 deletions

View File

@ -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';