Use taxonomy instead of post2cat. see #4189

git-svn-id: https://develop.svn.wordpress.org/trunk@5592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-05-29 16:52:31 +00:00
parent 1a08c04371
commit e0bf0ffa02
4 changed files with 21 additions and 30 deletions

View File

@@ -849,6 +849,7 @@ class WP_Query {
$cat = intval($cat);
$in = (strpos($cat, '-') !== false) ? false : true;
$cat = trim($cat, '-');
// TODO make an array, not a string, for out_cats. use get_term_children()
if ( $in )
$in_cats .= "$cat, " . get_category_children($cat, '', ', ');
else
@@ -860,7 +861,7 @@ class WP_Query {
$in_cats = " AND $wpdb->term_taxonomy.term_id IN ({$q['cat']}) ";
if ( strlen($out_cats) > 0 ) {
// TODO use get_objects_in_term
$ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.category_id IN ($out_cats)");
$ids = get_objects_in_terms($out_cats, 'category');
if ( is_array($ids) && count($ids > 0) ) {
foreach ( $ids as $id )
$out_posts .= "$id, ";