From ed60d52e697cf0d1b0e08c9cc864ef1785a64af8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 17 Dec 2014 17:36:43 +0000 Subject: [PATCH] Update individual term caches in `get_terms()`. Merges [30954] to the 4.1 branch. props boonebgorges. fixes #30749. see #21760. Built from https://develop.svn.wordpress.org/branches/4.1@30959 git-svn-id: http://core.svn.wordpress.org/branches/4.1@30947 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 );