Coding Standards: Use Yoda conditions where appropriate.

See #49222.

git-svn-id: https://develop.svn.wordpress.org/trunk@47219 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-02-09 16:52:28 +00:00
parent 40ffe0ef06
commit 130751cda3
124 changed files with 554 additions and 554 deletions
+3 -3
View File
@@ -1138,11 +1138,11 @@ class WP_Comment_Query {
}
$parsed = false;
if ( $orderby == $this->query_vars['meta_key'] || $orderby == 'meta_value' ) {
if ( $this->query_vars['meta_key'] === $orderby || 'meta_value' === $orderby ) {
$parsed = "$wpdb->commentmeta.meta_value";
} elseif ( $orderby == 'meta_value_num' ) {
} elseif ( 'meta_value_num' === $orderby ) {
$parsed = "$wpdb->commentmeta.meta_value+0";
} elseif ( $orderby == 'comment__in' ) {
} elseif ( 'comment__in' === $orderby ) {
$comment__in = implode( ',', array_map( 'absint', $this->query_vars['comment__in'] ) );
$parsed = "FIELD( {$wpdb->comments}.comment_ID, $comment__in )";
} elseif ( in_array( $orderby, $allowed_keys ) ) {