diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 5f9eb6d44f..59f162a198 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1604,6 +1604,11 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { wp_set_object_terms($object, $terms, $taxonomy); } + // Clean the relationship caches for all object types using this term + $tax_object = get_taxonomy( $taxonomy ); + foreach ( $tax_object->object_type as $object_type ) + clean_object_term_cache( $objects, $object_type ); + do_action( 'delete_term_taxonomy', $tt_id ); $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) ); do_action( 'deleted_term_taxonomy', $tt_id );