Created
April 23, 2014 16:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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