Ticket #29885: 29885.3.patch
File 29885.3.patch, 2.1 KB (added by , 10 years ago) |
---|
-
wp-includes/comment.php
258 258 * 259 259 * @since 3.1.0 260 260 * @since 4.1.0 Introduced 'comment__in', 'comment__not_in', 261 * 'post_author__in', 'post_author__not_in', 262 * 'author__in', 'author__not_in', 261 263 * 'post__in', and 'post__not_in' to $query_vars. 262 264 * 263 265 * @param string|array $query_vars … … 268 270 269 271 $defaults = array( 270 272 'author_email' => '', 273 'author__in' => '', 274 'author__not_in' => '', 271 275 'fields' => '', 272 276 'ID' => '', 273 277 'comment__in' => '', … … 278 282 'orderby' => '', 279 283 'order' => 'DESC', 280 284 'parent' => '', 285 'post_author__in' => '', 286 'post_author__not_in' => '', 281 287 'post_ID' => '', 282 288 'post_id' => 0, 283 289 'post__in' => '', … … 476 482 $where .= $wpdb->prepare( " AND {$wpdb->posts}.{$field_name} = %s", $field_value ); 477 483 } 478 484 485 if ( ! empty( $this->query_vars['author__in'] ) ) { 486 $where .= ' AND user_id IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__in'] ) ) . ' )'; 487 } 488 489 if ( ! empty( $this->query_vars['author__not_in'] ) ) { 490 $where .= ' AND user_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__not_in'] ) ) . ' )'; 491 } 492 493 if ( ! empty( $this->query_vars['post_author__in'] ) ) { 494 if ( empty( $join ) ) { 495 $join = "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID"; 496 } 497 $where .= ' AND post_author IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post_author__in'] ) ) . ' )'; 498 } 499 500 if ( ! empty( $this->query_vars['post_author__not_in'] ) ) { 501 if ( empty( $join ) ) { 502 $join = "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID"; 503 } 504 $where .= ' AND post_author NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post_author__not_in'] ) ) . ' )'; 505 } 506 479 507 if ( ! empty( $this->meta_query->queries ) ) { 480 508 $clauses = $this->meta_query->get_sql( 'comment', $wpdb->comments, 'comment_ID', $this ); 481 509 $join .= $clauses['join'];