Make WordPress Core

Ticket #59442: 59442.diff

File 59442.diff, 965 bytes (added by peterwilsoncc, 16 months ago)
  • src/wp-includes/class-wp-query.php

    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 { 
    25472547                        $post_type_where  = $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type );
    25482548                        $post_type_object = get_post_type_object( $post_type );
    25492549                } elseif ( $this->is_attachment ) {
     2550                        $post_type        = 'attachment';
    25502551                        $post_type_where  = " AND {$wpdb->posts}.post_type = 'attachment'";
    25512552                        $post_type_object = get_post_type_object( 'attachment' );
    25522553                } elseif ( $this->is_page ) {
     2554                        $post_type        = 'page';
    25532555                        $post_type_where  = " AND {$wpdb->posts}.post_type = 'page'";
    25542556                        $post_type_object = get_post_type_object( 'page' );
    25552557                } else {
     2558                        $post_type        = 'post';
    25562559                        $post_type_where  = " AND {$wpdb->posts}.post_type = 'post'";
    25572560                        $post_type_object = get_post_type_object( 'post' );
    25582561                }