From e1ebba28d4ec8e6d89d6bc17e548c4daa701bf23 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 17 Dec 2014 16:39:24 +0000 Subject: [PATCH] Update individual term caches in `get_terms()`. This was removed in [29915] as part of the attempt to add cache support to `get_term_by()`. When that support was removed in [30900], it was not properly restored. This changeset includes a unit test to verify that the cache is properly primed for terms found in `get_terms()`, as well as tests to verify the other cache setting that was touched by [30900]. Fixes #30749. See #21760. Built from https://develop.svn.wordpress.org/trunk@30954 git-svn-id: http://core.svn.wordpress.org/trunk@30942 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index f4076218a9..1d93f69047 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1912,6 +1912,9 @@ function get_terms( $taxonomies, $args = '' ) { } $terms = $wpdb->get_results($query); + if ( 'all' == $_fields ) { + update_term_cache( $terms ); + } if ( empty($terms) ) { wp_cache_add( $cache_key, array(), 'terms', DAY_IN_SECONDS );