From 7f14907c42e35ecf14a004302bf267f82ac14faf Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 25 Nov 2008 22:12:36 +0000 Subject: [PATCH] Update object term cache from get_the_category() git-svn-id: http://svn.automattic.com/wordpress/trunk@9885 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 65bb945e04..f42b039490 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -125,8 +125,10 @@ function get_the_category( $id = false ) { $id = (int) $post->ID; $categories = get_object_term_cache( $id, 'category' ); - if ( false === $categories ) + if ( false === $categories ) { $categories = wp_get_object_terms( $id, 'category' ); + wp_cache_add($post->ID, $categories, 'category_relationships'); + } if ( !empty( $categories ) ) usort( $categories, '_usort_terms_by_name' );