mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Introduce $wpdb->delete(). props justindgivens, scribu. fixes #18948.
git-svn-id: https://develop.svn.wordpress.org/trunk@20287 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1802,12 +1802,12 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) {
|
||||
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 ) );
|
||||
$wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $tt_id ) );
|
||||
do_action( 'deleted_term_taxonomy', $tt_id );
|
||||
|
||||
// Delete the term if no taxonomies use it.
|
||||
if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) )
|
||||
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->terms WHERE term_id = %d", $term) );
|
||||
$wpdb->delete( $wpdb->terms, array( 'term_id' => $term ) );
|
||||
|
||||
clean_term_cache($term, $taxonomy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user