mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Clean the cache when deleting a term. Fixes #15651
git-svn-id: https://develop.svn.wordpress.org/trunk@16691 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user