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:
parent
063f1b5680
commit
b0b22ceb97
|
@ -1604,6 +1604,11 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) {
|
||||||
wp_set_object_terms($object, $terms, $taxonomy);
|
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 );
|
do_action( 'delete_term_taxonomy', $tt_id );
|
||||||
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $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 );
|
do_action( 'deleted_term_taxonomy', $tt_id );
|
||||||
|
|
Loading…
Reference in New Issue