Make WordPress Core

Changeset 6490


Ignore:
Timestamp:
12/24/2007 09:21:16 PM (17 years ago)
Author:
ryan
Message:

Fetch only post category terms in get_posts(). Props MichaelH. fixes #5317

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r6425 r6490  
    366366    $query .= empty( $post_status ) ? '' : $wpdb->prepare("AND post_status = %s ", $post_status);
    367367    $query .= "$exclusions $inclusions " ;
    368     $query .= empty( $category ) ? '' : $wpdb->prepare("AND ($wpdb->posts.ID = $wpdb->term_relationships.object_id AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id AND $wpdb->term_taxonomy.term_id = %d) ", $category);
     368    $query .= empty( $category ) ? '' : $wpdb->prepare("AND ($wpdb->posts.ID = $wpdb->term_relationships.object_id AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id AND $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy = 'category')");
    369369    $query .= empty( $post_parent ) ? '' : $wpdb->prepare("AND $wpdb->posts.post_parent = %d ", $post_parent);
    370370    // expected_slashed ($meta_key, $meta_value) -- Also, this looks really funky, doesn't seem like it works
Note: See TracChangeset for help on using the changeset viewer.