function auto_nodetitle_operations_update in Automatic Nodetitles 7
Same name and namespace in other branches
- 8 auto_nodetitle.module \auto_nodetitle_operations_update()
- 5 auto_nodetitle.module \auto_nodetitle_operations_update()
- 6 auto_nodetitle.module \auto_nodetitle_operations_update()
Callback function for updating node titles.
1 call to auto_nodetitle_operations_update()
- drush_auto_nodetitle_drush_update in ./
auto_nodetitle.drush.inc - Drush callback to perform actual auto_nodetitle preset flush.
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 163 - 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);
}
}
}
}