WordPress.org

Make WordPress Core

Ticket #6772: 6772.2.diff

File 6772.2.diff, 522 bytes (added by DD32, 6 years ago)
  • wp-includes/query.php

     
    13371337                        } 
    13381338                        foreach ( $statuswheres as $statuswhere ) 
    13391339                                $where .= " AND $statuswhere"; 
    1340                 } elseif ( !$this->is_singular ) { 
     1340                } elseif ( !$this->is_singular && ! ( isset($q['post_type']) && 'attachment' == $q['post_type'] ) ) { 
    13411341                        $where .= " AND ($wpdb->posts.post_status = 'publish'"; 
    13421342 
    13431343                        if ( is_admin() )