Make WordPress Core


Ignore:
Timestamp:
05/29/2007 04:52:31 PM (18 years ago)
Author:
ryan
Message:

Use taxonomy instead of post2cat. see #4189

File:
1 edited

Legend:

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

    r5585 r5592  
    850850                $in = (strpos($cat, '-') !== false) ? false : true;
    851851                $cat = trim($cat, '-');
     852                // TODO make an array, not a string, for out_cats.  use get_term_children()
    852853                if ( $in )
    853854                    $in_cats .= "$cat, " . get_category_children($cat, '', ', ');
     
    861862            if ( strlen($out_cats) > 0 ) {
    862863                // TODO use get_objects_in_term
    863                 $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.category_id IN ($out_cats)");
     864                $ids = get_objects_in_terms($out_cats, 'category');
    864865                if ( is_array($ids) && count($ids > 0) ) {
    865866                    foreach ( $ids as $id )
Note: See TracChangeset for help on using the changeset viewer.