From 46110c7774557ab19851c7d02854f3aaea4d0a2f Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 2 Jul 2007 15:47:27 +0000 Subject: [PATCH] Delete term relationship only for the given object. git-svn-id: http://svn.automattic.com/wordpress/trunk@5774 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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); } }