Make WordPress Core


Ignore:
Timestamp:
05/30/2007 03:36:59 AM (19 years ago)
Author:
ryan
Message:

Some term caching. see #4189

File:
1 edited

Legend:

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

    r5590 r5598  
    6161
    6262function get_the_category($id = false) {
    63     global $post, $category_cache, $blog_id;
     63    global $post, $term_cache, $blog_id;
    6464
    6565    $id = (int) $id;
     
    6767        $id = (int) $post->ID;
    6868
    69     $categories = get_object_terms($id, 'category');
     69    $categories = get_post_term_cache($id, 'category');
     70    if ( false === $categories )
     71        $categories = get_object_terms($id, 'category');
    7072
    7173    if ( !empty($categories) )
     
    417419        $id = (int) $post->ID;
    418420
    419     $tags = wp_get_post_tags( $id );
     421    $tags = get_post_term_cache($id, 'post_tag');
     422    if ( false === $tags )
     423        $tags = get_object_terms($id, 'post_tag');
     424
    420425    $tags = apply_filters( 'get_the_tags', $tags );
    421426    if ( empty( $tags ) )
Note: See TracChangeset for help on using the changeset viewer.