From 6c3655ce31167de8c7a74090fd34b5d910bc08c8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 22 Sep 2012 15:21:30 +0000 Subject: [PATCH] Don't repeatedly call get_object_taxonomies() in clean_object_term_cache(). see #11399. git-svn-id: https://develop.svn.wordpress.org/trunk@21951 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index a0f87d7a23..ea869d0265 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2559,8 +2559,10 @@ function clean_object_term_cache($object_ids, $object_type) { if ( !is_array($object_ids) ) $object_ids = array($object_ids); + $taxonomies = get_object_taxonomies( $object_type ); + foreach ( $object_ids as $id ) - foreach ( get_object_taxonomies($object_type) as $taxonomy ) + foreach ( $taxonomies as $taxonomy ) wp_cache_delete($id, "{$taxonomy}_relationships"); do_action('clean_object_term_cache', $object_ids, $object_type);