Ticket #29885: 29885.diff
File 29885.diff, 1.1 KB (added by , 11 years ago) |
---|
-
wp-includes/comment.php
475 475 foreach( $post_fields as $field_name => $field_value ) 476 476 $where .= $wpdb->prepare( " AND {$wpdb->posts}.{$field_name} = %s", $field_value ); 477 477 } 478 479 if ( ! empty( $this->query_vars['author__in'] ) ) { 480 if ( empty( $join ) ) { 481 $join = "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID"; 482 } 483 $where .= ' AND post_author IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__in'] ) ) . ' )'; 484 } 478 485 486 if ( ! empty( $this->query_vars['author__not_in'] ) ) { 487 if ( empty( $join ) ) { 488 $join = "JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID"; 489 } 490 $where .= ' AND post_author NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['author__not_in'] ) ) . ' )'; 491 } 492 479 493 if ( ! empty( $this->meta_query->queries ) ) { 480 494 $clauses = $this->meta_query->get_sql( 'comment', $wpdb->comments, 'comment_ID', $this ); 481 495 $join .= $clauses['join'];