mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 14:53:08 +02:00
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. Built from https://develop.svn.wordpress.org/trunk@31287 git-svn-id: http://core.svn.wordpress.org/trunk@31268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
67d36f845d
commit
dcca015ffc
@ -3783,7 +3783,7 @@ function update_object_term_cache($object_ids, $object_type) {
|
||||
|
||||
$object_terms = array();
|
||||
foreach ( (array) $terms as $term )
|
||||
$object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term;
|
||||
$object_terms[$term->object_id][$term->taxonomy][] = $term;
|
||||
|
||||
foreach ( $ids as $id ) {
|
||||
foreach ( $taxonomies as $taxonomy ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31286';
|
||||
$wp_version = '4.2-alpha-31287';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user