From 35f2f13526120e1ed2e71ea81db063080f7a6598 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 2 Jul 2007 15:47:27 +0000 Subject: [PATCH] Delete term relationship only for the given object. git-svn-id: https://develop.svn.wordpress.org/trunk@5774 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 0780a632bb..89dbae67a2 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -704,7 +704,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { $delete_terms = array_diff($old_terms, $tt_ids); if ( $delete_terms ) { $in_delete_terms = "'" . implode("', '", $delete_terms) . "'"; - $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE term_taxonomy_id IN ($in_delete_terms)"); + $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE object_id = '$object_id' AND term_taxonomy_id IN ($in_delete_terms)"); wp_update_term_count($delete_terms, $taxonomy); } }