mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Seeing double. Good spot momo360modena. fixes #4251 for 2.1, 2.2 and 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f417e94b89
commit
24399dcbfb
@ -229,14 +229,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 ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user