Changeset 5111 for trunk/wp-includes/functions.php
- Timestamp:
- 03/26/2007 08:08:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r5109 r5111 636 636 637 637 function update_post_category_cache($post_ids) { 638 global $wpdb, $category_cache, $ blog_id;638 global $wpdb, $category_cache, $tag_cache, $blog_id; 639 639 640 640 if ( empty($post_ids) ) … … 657 657 $post_id_list = join( ',', $post_id_array ); // with already cached stuff removed 658 658 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)"); 660 660 661 661 if ( empty($dogs) ) 662 662 return; 663 663 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 } 666 670 } 667 671
Note: See TracChangeset
for help on using the changeset viewer.