Make WordPress Core


Ignore:
Timestamp:
01/28/2015 08:42:25 PM (10 years ago)
Author:
boonebgorges
Message:

Don't use term IDs for array indexes when caching object terms.

Uncached results pulled from wp_get_object_terms() are zero-indexed (ie 0,
1, 2...). As a result, get_the_terms() was returning a strictly different
array when pulling from the cache and when the cache was empty.

Props joshlevinson.
Fixes #31086.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r31285 r31287  
    37843784    $object_terms = array();
    37853785    foreach ( (array) $terms as $term )
    3786         $object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term;
     3786        $object_terms[$term->object_id][$term->taxonomy][] = $term;
    37873787
    37883788    foreach ( $ids as $id ) {
Note: See TracChangeset for help on using the changeset viewer.