WordPress.org

Make WordPress Core

Changeset 11817


Ignore:
Timestamp:
08/15/09 03:28:03 (6 years ago)
Author:
markjaquith
Message:

Always respect custom post_type in queries. props dd32, filosofo. fixes #10605

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r11749 r11817  
    20732073        if ( 'any' == $post_type ) { 
    20742074            $where .= " AND $wpdb->posts.post_type != 'revision'"; 
     2075        } elseif ( ! empty( $post_type ) ) { 
     2076            $where .= " AND $wpdb->posts.post_type = '$post_type'"; 
    20752077        } elseif ( $this->is_attachment ) { 
    20762078            $where .= " AND $wpdb->posts.post_type = 'attachment'"; 
     
    20792081        } elseif ($this->is_single) { 
    20802082            $where .= " AND $wpdb->posts.post_type = 'post'"; 
    2081         } else { 
    2082             $where .= " AND $wpdb->posts.post_type = '$post_type'"; 
    20832083        } 
    20842084 
Note: See TracChangeset for help on using the changeset viewer.