Changeset 27067
- Timestamp:
- 02/02/2014 07:35:54 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r27018 r27067 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)"; 2762 } 2761 2763 } elseif ( !$this->is_singular ) { 2762 2764 $where .= " AND ($wpdb->posts.post_status = 'publish'"; -
trunk/tests/phpunit/tests/query.php
r25601 r27067 77 77 $this->assertEquals( get_the_ID(), $post_id ); 78 78 } 79 80 79 } 81 80 } -
trunk/tests/phpunit/tests/query/results.php
r26479 r27067 534 534 $this->assertFalse( $this->q->is_year ); 535 535 } 536 537 function test_perm_with_status_array() { 538 global $wpdb; 539 $this->q->query( array( 'perm' => 'readable', 'post_status' => array( 'publish', 'private' ) ) ); 540 $this->assertTrue( $this->q->have_posts() ); 541 $this->assertContains( "(({$wpdb->posts}.post_status = 'publish') OR ({$wpdb->posts}.post_author = 0 AND ({$wpdb->posts}.post_status = 'private')))", 542 $this->q->request 543 ); 544 $this->assertNotContains( "({$wpdb->posts}.post_status = 'publish') AND", $this->q->request ); 545 } 536 546 }
Note: See TracChangeset
for help on using the changeset viewer.