Changeset 5459 for branches/2.2/wp-includes/post.php
- Timestamp:
- 05/12/2007 07:47:47 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/wp-includes/post.php
r5289 r5459 225 225 if (!empty($exclusions)) 226 226 $exclusions .= ')'; 227 228 $query ="SELECT DISTINCT * FROM $wpdb->posts " ;229 $query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " );230 $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " );231 $query .= " WHERE (post_type = 'post' AND post_status = 'publish') $exclusions $inclusions ";232 $query .= ( empty( $category ) ? "" : "AND ($wpdb->posts.ID = $wpdb->post2cat.post_id AND $wpdb->post2cat.category_id = " . $category. ") " );233 $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' )" );234 $query .= " GROUP BY $wpdb->posts.ID ORDER BY " . $orderby . " " . $order . " LIMIT " . $offset . ',' . $numberposts;235 227 236 228 $query = "SELECT DISTINCT * FROM $wpdb->posts ";
Note: See TracChangeset
for help on using the changeset viewer.