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
This commit is contained in:
rob1n 2007-05-12 19:47:47 +00:00
parent 906b220ad7
commit 2e915e21af
1 changed files with 0 additions and 8 deletions

View File

@ -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 ";