Delete term relationship only for the given object.

git-svn-id: https://develop.svn.wordpress.org/trunk@5774 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-07-02 15:47:27 +00:00
parent afb1d283b0
commit 35f2f13526
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
}