diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
index f683a52bd1..f41507f93f 100644
a
|
b
|
class WP_Query { |
2547 | 2547 | $post_type_where = $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type ); |
2548 | 2548 | $post_type_object = get_post_type_object( $post_type ); |
2549 | 2549 | } elseif ( $this->is_attachment ) { |
| 2550 | $post_type = 'attachment'; |
2550 | 2551 | $post_type_where = " AND {$wpdb->posts}.post_type = 'attachment'"; |
2551 | 2552 | $post_type_object = get_post_type_object( 'attachment' ); |
2552 | 2553 | } elseif ( $this->is_page ) { |
| 2554 | $post_type = 'page'; |
2553 | 2555 | $post_type_where = " AND {$wpdb->posts}.post_type = 'page'"; |
2554 | 2556 | $post_type_object = get_post_type_object( 'page' ); |
2555 | 2557 | } else { |
| 2558 | $post_type = 'post'; |
2556 | 2559 | $post_type_where = " AND {$wpdb->posts}.post_type = 'post'"; |
2557 | 2560 | $post_type_object = get_post_type_object( 'post' ); |
2558 | 2561 | } |