function auto_nodetitle_operations_update in Automatic Nodetitles 8
Same name and namespace in other branches
- 5 auto_nodetitle.module \auto_nodetitle_operations_update()
- 6 auto_nodetitle.module \auto_nodetitle_operations_update()
- 7 auto_nodetitle.module \auto_nodetitle_operations_update()
Callback function for updating node titles.
1 string reference to 'auto_nodetitle_operations_update'
- auto_nodetitle_node_operations in ./
auto_nodetitle.module - Implements hook_node_operations().
File
- ./
auto_nodetitle.module, line 118 - Allows hiding of the node title field and automatic title creation.
Code
function auto_nodetitle_operations_update($nodes) {
foreach ($nodes as $nid) {
$node = node_load($nid);
if ($node && auto_nodetitle_is_needed($node)) {
$previous_title = $node->title;
auto_nodetitle_set_title($node);
// Only save if the title has actually changed.
if ($node->title != $previous_title) {
node_save($node);
}
}
}
}