You are here

function pathauto_persist_nodeapi in Pathauto Persistent State 6

Implements hook_nodeapi().

File

./pathauto_persist.module, line 6

Code

function pathauto_persist_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if (($op == 'load' || $op == 'presave') && !empty($node->nid) && !isset($node->pathauto_perform_alias)) {
    $node->pathauto_perform_alias = pathauto_persist_entity_state_load('node', $node->nid);
  }
  elseif (($op == 'insert' || $op == 'update') && isset($node->pathauto_perform_alias)) {
    pathauto_persist_entity_state_save('node', $node->nid, $node->pathauto_perform_alias);
  }
}