WordPress.org

Make WordPress Core

Changeset 6646


Ignore:
Timestamp:
01/23/08 23:38:30 (6 years ago)
Author:
ryan
Message:

Don't forget to pass the category

File:
1 edited

Legend:

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

    r6645 r6646  
    442442    $query .= empty( $post_status ) ? '' : $wpdb->prepare("AND post_status = %s ", $post_status); 
    443443    $query .= "$exclusions $inclusions " ; 
    444     $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')"); 
     444    $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')", $category); 
    445445    $query .= empty( $post_parent ) ? '' : $wpdb->prepare("AND $wpdb->posts.post_parent = %d ", $post_parent); 
    446446    // 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.