Make WordPress Core

Changeset 16487


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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r16414 r16487  
    169169                    parse_str($tax_url['query'], $query_vars);
    170170                    $redirect['query'] = add_query_arg($query_vars, $redirect['query']);
     171                    error_log('ugly redir');
    171172                } else { // Taxonomy is accessable via a "pretty-URL"
    172173                    $redirect['path'] = $tax_url['path'];
     174                    error_log('pretty redir');
    173175                }
    174176            }
  • 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.