diff --git src/wp-includes/query.php src/wp-includes/query.php
index 417405d..fd1ae2e 100644
|
|
|
class WP_Query { |
| 2756 | 2756 | foreach ( $statuswheres as $index => $statuswhere ) |
| 2757 | 2757 | $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))"; |
| 2758 | 2758 | } |
| 2759 | | foreach ( $statuswheres as $statuswhere ) |
| 2760 | | $where .= " AND $statuswhere"; |
| | 2759 | $where_status = implode(' OR ', $statuswheres); |
| | 2760 | if(!empty($where_status)) |
| | 2761 | $where .= " AND ($where_status)"; |
| 2761 | 2762 | } elseif ( !$this->is_singular ) { |
| 2762 | 2763 | $where .= " AND ($wpdb->posts.post_status = 'publish'"; |
| 2763 | 2764 | |
diff --git tests/phpunit/tests/query/results.php tests/phpunit/tests/query/results.php
index 404aea6..992d1b9 100644
|
|
|
class Tests_Query_Results extends WP_UnitTestCase { |
| 533 | 533 | $this->assertFalse( $this->q->is_month ); |
| 534 | 534 | $this->assertFalse( $this->q->is_year ); |
| 535 | 535 | } |
| | 536 | |
| | 537 | /** |
| | 538 | * @ticket 25523 |
| | 539 | */ |
| | 540 | function test_query_post_readable_perm() { |
| | 541 | $posts = $this->q->query( array( |
| | 542 | 'post_status' => array('publish', 'private'), |
| | 543 | 'perm' => 'readable' |
| | 544 | ) ); |
| | 545 | |
| | 546 | $this->assertTrue($this->q->found_posts > 0); |
| | 547 | } |
| 536 | 548 | } |