Make WordPress Core

Ticket #50070: 50070.diff

File 50070.diff, 428 bytes (added by Howdy_McGee, 4 years ago)

Set WP_Query Post Type When Empty.

  • class-wp-query.php

     
    25442544
    25452545                        $where .= ')';
    25462546                }
     2547               
     2548                // Attempt to set post type prior to filters.
     2549                if( empty( $q['post_type'] ) ) {
     2550                        $q['post_type'] = $post_type;
     2551                }
    25472552
    25482553                /*
    25492554                 * Apply filters on where and join prior to paging so that any