mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Comment Query: Use $this->query_vars instead of the nonexistent shorthand $q. see #23208.
git-svn-id: http://core.svn.wordpress.org/trunk@23325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9b5e67bf7d
commit
abd37fe4a7
@ -292,13 +292,13 @@ class WP_Comment_Query {
|
||||
'user_id',
|
||||
);
|
||||
if ( ! empty( $this->query_vars['meta_key'] ) ) {
|
||||
$allowed_keys[] = $q['meta_key'];
|
||||
$allowed_keys[] = $this->query_vars['meta_key'];
|
||||
$allowed_keys[] = 'meta_value';
|
||||
$allowed_keys[] = 'meta_value_num';
|
||||
}
|
||||
$ordersby = array_intersect( $ordersby, $allowed_keys );
|
||||
foreach ( $ordersby as $key => $value ) {
|
||||
if ( $value == $q['meta_key'] || $value == 'meta_value' ) {
|
||||
if ( $value == $this->query_vars['meta_key'] || $value == 'meta_value' ) {
|
||||
$ordersby[ $key ] = "$wpdb->commentmeta.meta_value";
|
||||
} elseif ( $value == 'meta_value_num' ) {
|
||||
$ordersby[ $key ] = "$wpdb->commentmeta.meta_value+0";
|
||||
|
Loading…
Reference in New Issue
Block a user