Ticket #10791: multiple-post-types.patch
| File multiple-post-types.patch, 1.0 KB (added by , 16 years ago) |
|---|
-
query.php
1486 1486 } 1487 1487 } 1488 1488 1489 if ( !empty($qv['post_type']) ) 1490 $qv['post_type'] = sanitize_user($qv['post_type'], true); 1489 if ( !empty($qv['post_type']) ) { 1490 if(is_array($qv['post_type'])) 1491 $qv['post_type'] = array_map('sanitize_user', $qv['post_type'], array(true)); 1492 else 1493 $qv['post_type'] = sanitize_user($qv['post_type'], true); 1494 } 1491 1495 1492 1496 if ( !empty($qv['post_status']) ) 1493 1497 $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']); … … 2072 2076 2073 2077 if ( 'any' == $post_type ) { 2074 2078 $where .= " AND $wpdb->posts.post_type != 'revision'"; 2079 } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { 2080 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')"; 2075 2081 } elseif ( ! empty( $post_type ) ) { 2076 2082 $where .= " AND $wpdb->posts.post_type = '$post_type'"; 2077 2083 } elseif ( $this->is_attachment ) {