From d7fccb6c019a394a338fdc09020f91c1fc2e4e3e Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 23 Dec 2015 19:28:06 +0000 Subject: [PATCH] Respect `$_wp_suspend_cache_invalidation` in `clean_object_term_cache()`. Props mwidmann. Fixes #35208. git-svn-id: https://develop.svn.wordpress.org/trunk@36076 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index a1d6e04686..aea48ca297 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -3456,12 +3456,20 @@ function wp_update_term_count_now( $terms, $taxonomy ) { * * @since 2.3.0 * + * @global bool $_wp_suspend_cache_invalidation + * * @see get_object_taxonomies() for more on $object_type. * * @param int|array $object_ids Single or list of term object ID(s). * @param array|string $object_type The taxonomy object type. */ function clean_object_term_cache($object_ids, $object_type) { + global $_wp_suspend_cache_invalidation; + + if ( ! empty( $_wp_suspend_cache_invalidation ) ) { + return; + } + if ( !is_array($object_ids) ) $object_ids = array($object_ids);