Ticket #10605: allow_custom_post_type.10605.more_efficient.diff
| File allow_custom_post_type.10605.more_efficient.diff, 812 bytes (added by , 17 years ago) |
|---|
-
wp-includes/query.php
2072 2072 2073 2073 if ( 'any' == $post_type ) { 2074 2074 $where .= " AND $wpdb->posts.post_type != 'revision'"; 2075 } elseif ( ! empty( $post_type ) ) { 2076 $where .= " AND $wpdb->posts.post_type = '$post_type'"; 2075 2077 } elseif ( $this->is_attachment ) { 2076 2078 $where .= " AND $wpdb->posts.post_type = 'attachment'"; 2077 2079 } elseif ($this->is_page) { 2078 2080 $where .= " AND $wpdb->posts.post_type = 'page'"; 2079 2081 } elseif ($this->is_single) { 2080 2082 $where .= " AND $wpdb->posts.post_type = 'post'"; 2081 } else {2082 $where .= " AND $wpdb->posts.post_type = '$post_type'";2083 2083 } 2084 2084 2085 2085 if ( isset($q['post_status']) && '' != $q['post_status'] ) {