diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index a4cc7e2..5c5f737 100644
|
a
|
b
|
public function query( $query_vars ) { |
| 303 | 303 | return $cache; |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | | $status = $this->query_vars['status']; |
| 307 | | if ( 'hold' == $status ) { |
| 308 | | $approved = "comment_approved = '0'"; |
| 309 | | } elseif ( 'approve' == $status ) { |
| 310 | | $approved = "comment_approved = '1'"; |
| 311 | | } elseif ( ! empty( $status ) && 'all' != $status ) { |
| 312 | | $approved = $wpdb->prepare( "comment_approved = %s", $status ); |
| 313 | | } else { |
| 314 | | $approved = "( comment_approved = '0' OR comment_approved = '1' )"; |
| | 306 | $status_queries = array(); |
| | 307 | $statuses = empty( $this->query_vars['status'] ) ? array( 'all' ) : (array) $this->query_vars['status']; |
| | 308 | |
| | 309 | foreach ( $statuses as $s ) { |
| | 310 | if ( 'hold' == $s || '0' == $s ) { |
| | 311 | $status_queries['hold'] = "comment_approved = '0'"; |
| | 312 | } elseif ( 'approve' == $s || '1' == $s ) { |
| | 313 | $status_queries['approve'] = "comment_approved = '1'"; |
| | 314 | } elseif ( 'all' == $s ) { |
| | 315 | $status_queries['hold'] = "comment_approved = '0'"; |
| | 316 | $status_queries['approve'] = "comment_approved = '1'"; |
| | 317 | } else { |
| | 318 | $status_queries[ $s ] = $wpdb->prepare( "comment_approved = %s", $s ); |
| | 319 | } |
| 315 | 320 | } |
| | 321 | |
| | 322 | $approved = "( " . implode( " OR ", $status_queries ) . " )"; |
| | 323 | |
| 316 | 324 | $order = ( 'ASC' == strtoupper( $this->query_vars['order'] ) ) ? 'ASC' : 'DESC'; |
| 317 | 325 | |
| 318 | 326 | if ( ! empty( $this->query_vars['orderby'] ) ) { |
| … |
… |
public function query( $query_vars ) { |
| 466 | 474 | if ( $groupby ) { |
| 467 | 475 | $groupby = 'GROUP BY ' . $groupby; |
| 468 | 476 | } |
| | 477 | |
| 469 | 478 | $query = "SELECT $fields FROM $wpdb->comments $join WHERE $where $groupby ORDER BY $orderby $order $limits"; |
| 470 | 479 | |
| 471 | 480 | if ( $this->query_vars['count'] ) { |