Skip to content

Instantly share code, notes, and snippets.

@froboy
Created April 23, 2014 16:23
Show Gist options
  • Save froboy/11222175 to your computer and use it in GitHub Desktop.
Save froboy/11222175 to your computer and use it in GitHub Desktop.
PHP snippet for Drupal Views Bulk Operations to remove a selected taxonomy term from multiple nodes
$bad_tid = 0; // Enter the term id you wish to remove
foreach($entity->field_tags['und'] as $key => $term) {
if($term['tid'] == $bad_tid) unset ($entity->field_tags['und'][$key]);
}
node_save($entity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment