| @@ 693-695 (lines=3) @@ | ||
| 690 | $this->sql_clauses['where']['post__not_in'] = 'comment_post_ID NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post__not_in'] ) ) . ' )'; |
|
| 691 | } |
|
| 692 | ||
| 693 | if ( '' !== $this->query_vars['author_email'] ) { |
|
| 694 | $this->sql_clauses['where']['author_email'] = $wpdb->prepare( 'comment_author_email = %s', $this->query_vars['author_email'] ); |
|
| 695 | } |
|
| 696 | ||
| 697 | if ( '' !== $this->query_vars['author_url'] ) { |
|
| 698 | $this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] ); |
|
| @@ 697-699 (lines=3) @@ | ||
| 694 | $this->sql_clauses['where']['author_email'] = $wpdb->prepare( 'comment_author_email = %s', $this->query_vars['author_email'] ); |
|
| 695 | } |
|
| 696 | ||
| 697 | if ( '' !== $this->query_vars['author_url'] ) { |
|
| 698 | $this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] ); |
|
| 699 | } |
|
| 700 | ||
| 701 | if ( '' !== $this->query_vars['karma'] ) { |
|
| 702 | $this->sql_clauses['where']['karma'] = $wpdb->prepare( 'comment_karma = %d', $this->query_vars['karma'] ); |
|
| @@ 701-703 (lines=3) @@ | ||
| 698 | $this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] ); |
|
| 699 | } |
|
| 700 | ||
| 701 | if ( '' !== $this->query_vars['karma'] ) { |
|
| 702 | $this->sql_clauses['where']['karma'] = $wpdb->prepare( 'comment_karma = %d', $this->query_vars['karma'] ); |
|
| 703 | } |
|
| 704 | ||
| 705 | // Filtering by comment_type: 'type', 'type__in', 'type__not_in'. |
|
| 706 | $raw_types = array( |
|
| @@ 755-757 (lines=3) @@ | ||
| 752 | ||
| 753 | if ( is_array( $this->query_vars['user_id'] ) ) { |
|
| 754 | $this->sql_clauses['where']['user_id'] = 'user_id IN (' . implode( ',', array_map( 'absint', $this->query_vars['user_id'] ) ) . ')'; |
|
| 755 | } elseif ( '' !== $this->query_vars['user_id'] ) { |
|
| 756 | $this->sql_clauses['where']['user_id'] = $wpdb->prepare( 'user_id = %d', $this->query_vars['user_id'] ); |
|
| 757 | } |
|
| 758 | ||
| 759 | // Falsy search strings are ignored. |
|
| 760 | if ( strlen( $this->query_vars['search'] ) ) { |
|
| @@ 359-361 (lines=3) @@ | ||
| 356 | $this->sql_clauses['where']['network__not_in'] = "$wpdb->site.id NOT IN ( " . implode( ',', wp_parse_id_list( $this->query_vars['network__not_in'] ) ) . ' )'; |
|
| 357 | } |
|
| 358 | ||
| 359 | if ( ! empty( $this->query_vars['domain'] ) ) { |
|
| 360 | $this->sql_clauses['where']['domain'] = $wpdb->prepare( "$wpdb->site.domain = %s", $this->query_vars['domain'] ); |
|
| 361 | } |
|
| 362 | ||
| 363 | // Parse network domain for an IN clause. |
|
| 364 | if ( is_array( $this->query_vars['domain__in'] ) ) { |
|
| @@ 373-375 (lines=3) @@ | ||
| 370 | $this->sql_clauses['where']['domain__not_in'] = "$wpdb->site.domain NOT IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['domain__not_in'] ) ) . "' )"; |
|
| 371 | } |
|
| 372 | ||
| 373 | if ( ! empty( $this->query_vars['path'] ) ) { |
|
| 374 | $this->sql_clauses['where']['path'] = $wpdb->prepare( "$wpdb->site.path = %s", $this->query_vars['path'] ); |
|
| 375 | } |
|
| 376 | ||
| 377 | // Parse network path for an IN clause. |
|
| 378 | if ( is_array( $this->query_vars['path__in'] ) ) { |
|
| @@ 428-430 (lines=3) @@ | ||
| 425 | $this->sql_clauses['where']['network__not_in'] = 'site_id NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['network__not_in'] ) ) . ' )'; |
|
| 426 | } |
|
| 427 | ||
| 428 | if ( ! empty( $this->query_vars['domain'] ) ) { |
|
| 429 | $this->sql_clauses['where']['domain'] = $wpdb->prepare( 'domain = %s', $this->query_vars['domain'] ); |
|
| 430 | } |
|
| 431 | ||
| 432 | // Parse site domain for an IN clause. |
|
| 433 | if ( is_array( $this->query_vars['domain__in'] ) ) { |
|
| @@ 442-444 (lines=3) @@ | ||
| 439 | $this->sql_clauses['where']['domain__not_in'] = "domain NOT IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['domain__not_in'] ) ) . "' )"; |
|
| 440 | } |
|
| 441 | ||
| 442 | if ( ! empty( $this->query_vars['path'] ) ) { |
|
| 443 | $this->sql_clauses['where']['path'] = $wpdb->prepare( 'path = %s', $this->query_vars['path'] ); |
|
| 444 | } |
|
| 445 | ||
| 446 | // Parse site path for an IN clause. |
|
| 447 | if ( is_array( $this->query_vars['path__in'] ) ) { |
|