mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
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
This commit is contained in:
parent
d40280d0db
commit
fa38396998
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user