Changeset 30096 for trunk/src/wp-includes/comment.php
- Timestamp:
- 10/29/2014 09:49:08 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r30093 r30096 305 305 'status' => 'all', 306 306 'type' => '', 307 'type__in' => '', 308 'type__not_in' => '', 307 309 'user_id' => '', 308 310 'search' => '', … … 521 523 } 522 524 523 if ( 'comment' == $this->query_vars['type'] ) { 524 $where[] = "comment_type = ''"; 525 } elseif( 'pings' == $this->query_vars['type'] ) { 526 $where[] = 'comment_type IN ("pingback", "trackback")'; 527 } elseif ( ! empty( $this->query_vars['type'] ) ) { 528 $where[] = $wpdb->prepare( 'comment_type = %s', $this->query_vars['type'] ); 525 // Filtering by comment_type: 'type', 'type__in', 'type__not_in'. 526 $raw_types = array( 527 'IN' => array_merge( (array) $this->query_vars['type'], (array) $this->query_vars['type__in'] ), 528 'NOT IN' => (array) $this->query_vars['type__not_in'], 529 ); 530 531 $comment_types = array(); 532 foreach ( $raw_types as $operator => $_raw_types ) { 533 $_raw_types = array_unique( $_raw_types ); 534 535 foreach ( $_raw_types as $type ) { 536 switch ( $type ) { 537 // An empty translates to 'all', for backward compatibility 538 case '': 539 case 'all' : 540 break; 541 542 case 'comment': 543 case 'comments': 544 $comment_types[ $operator ][] = "''"; 545 break; 546 547 case 'pings': 548 $comment_types[ $operator ][] = "'pingback'"; 549 $comment_types[ $operator ][] = "'trackback'"; 550 break; 551 552 default: 553 $comment_types[ $operator ][] = $wpdb->prepare( '%s', $type ); 554 break; 555 } 556 } 557 558 if ( ! empty( $comment_types[ $operator ] ) ) { 559 $types_sql = implode( ', ', $comment_types[ $operator ] ); 560 $where[] = "comment_type $operator ($types_sql)"; 561 } 529 562 } 530 563
Note: See TracChangeset
for help on using the changeset viewer.