Make WordPress Core


Ignore:
Timestamp:
03/26/2007 08:08:31 AM (18 years ago)
Author:
matt
Message:

Basic theme support for tags.

File:
1 edited

Legend:

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

    r5109 r5111  
    636636
    637637function update_post_category_cache($post_ids) {
    638     global $wpdb, $category_cache, $blog_id;
     638    global $wpdb, $category_cache, $tag_cache, $blog_id;
    639639
    640640    if ( empty($post_ids) )
     
    657657    $post_id_list = join( ',', $post_id_array ); // with already cached stuff removed
    658658
    659     $dogs = $wpdb->get_results("SELECT post_id, category_id FROM $wpdb->post2cat WHERE post_id IN ($post_id_list)");
     659    $dogs = $wpdb->get_results("SELECT post_id, category_id, rel_type FROM $wpdb->post2cat WHERE post_id IN ($post_id_list)");
    660660
    661661    if ( empty($dogs) )
    662662        return;
    663663
    664     foreach ($dogs as $catt)
    665         $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id);
     664    foreach ($dogs as $catt) {
     665        if ( 'category' == $catt->rel_type )
     666            $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id);
     667        elseif ( 'tag' == $catt->rel_type )
     668            $tag_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id);
     669    }
    666670}
    667671
Note: See TracChangeset for help on using the changeset viewer.