Make WordPress Core


Ignore:
Timestamp:
11/23/2006 08:39:39 PM (19 years ago)
Author:
ryan
Message:

Key caches by blog ID for those doing the multi blog trick.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r4495 r4524  
    6161
    6262function get_the_category($id = false) {
    63 global $post, $category_cache;
     63global $post, $category_cache, $blog_id;
    6464
    6565    if ( !$id )
    6666        $id = $post->ID;
    6767
    68     if ( !isset($category_cache[$id]) )
     68    if ( !isset($category_cache[$blog_id][$id]) )
    6969        update_post_category_cache($id);
    7070
    71     $categories = $category_cache[$id];
     71    $categories = $category_cache[$blog_id][$id];
    7272
    7373    if ( !empty($categories) )
     
    141141
    142142function in_category($category) { // Check if the current post is in the given category
    143     global $category_cache, $post;
    144 
    145     if ( isset( $category_cache[$post->ID][$category] ) )
     143    global $category_cache, $post, $blog_id;
     144
     145    if ( isset( $category_cache[$blog_id][$post->ID][$category] ) )
    146146        return true;
    147147    else
Note: See TracChangeset for help on using the changeset viewer.