From 2e915e21afb444f7b3f8a65600330b2362cc8609 Mon Sep 17 00:00:00 2001 From: rob1n Date: Sat, 12 May 2007 19:47:47 +0000 Subject: [PATCH] Seeing double. Good spot momo360modena. fixes #4251 for 2.1, 2.2 and 2.3 git-svn-id: http://svn.automattic.com/wordpress/branches/2.1@5459 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 1972a62956..bdafb7f636 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -225,14 +225,6 @@ function get_posts($args) { if (!empty($exclusions)) $exclusions .= ')'; - $query ="SELECT DISTINCT * FROM $wpdb->posts " ; - $query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " ); - $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ); - $query .= " WHERE (post_type = 'post' AND post_status = 'publish') $exclusions $inclusions "; - $query .= ( empty( $category ) ? "" : "AND ($wpdb->posts.ID = $wpdb->post2cat.post_id AND $wpdb->post2cat.category_id = " . $category. ") " ); - $query .= ( empty( $meta_key ) | empty($meta_value) ? "" : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" ); - $query .= " GROUP BY $wpdb->posts.ID ORDER BY " . $orderby . " " . $order . " LIMIT " . $offset . ',' . $numberposts; - $query = "SELECT DISTINCT * FROM $wpdb->posts "; $query .= empty( $category ) ? '' : ", $wpdb->post2cat "; $query .= empty( $meta_key ) ? '' : ", $wpdb->postmeta ";