Make WordPress Core


Ignore:
Timestamp:
11/19/2010 05:09:21 PM (14 years ago)
Author:
ryan
Message:

Populate post term relationship cache in get_the_terms(). Restores caching lost when we moved away from get_the_category(). see #15407

File:
1 edited

Legend:

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

    r16478 r16487  
    10671067
    10681068    $terms = get_object_term_cache( $id, $taxonomy );
    1069     if ( false === $terms )
     1069    if ( false === $terms ) {
    10701070        $terms = wp_get_object_terms( $id, $taxonomy );
    1071 
     1071        wp_cache_add($id, $terms, $taxonomy . '_relationships');
     1072    }
     1073   
    10721074    $terms = apply_filters( 'get_the_terms', $terms, $id, $taxonomy );
    10731075
Note: See TracChangeset for help on using the changeset viewer.