Skip to content

Instantly share code, notes, and snippets.

@lkacenja
Created January 26, 2018 23:45
Show Gist options
  • Save lkacenja/85439af05798e3290782ea324873088e to your computer and use it in GitHub Desktop.
Save lkacenja/85439af05798e3290782ea324873088e to your computer and use it in GitHub Desktop.
$nodes = node_load_multiple(array(), array('type' => 'trail'));
foreach($nodes AS $node) {
if (empty($node->field_trail_type[LANGUAGE_NONE])) {
$node->field_trail_type[LANGUAGE_NONE][0]['tid']= 135;
node_save($node);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment