You are here

function auto_nodetitle_node_presave in Automatic Nodetitles 8

Same name and namespace in other branches
  1. 7 auto_nodetitle.module \auto_nodetitle_node_presave()

Implements hook_ENTITY_TYPE_presave().

File

./auto_nodetitle.module, line 63
Allows hiding of the node title field and automatic title creation.

Code

function auto_nodetitle_node_presave(EntityInterface $entity) {

  // If not yet done, generate the title now.
  if (auto_nodetitle_is_needed($entity)) {
    auto_nodetitle_set_title($entity);
  }
}