function path_node_update

path_node_update($node)

Implements hook_node_update().

File

modules/path/path.module, line 205
Enables users to rename URLs.

Code

function path_node_update($node) {
  if (isset($node->path)) {
    $path = $node->path;
    $path['alias'] = isset($path['alias']) ? trim($path['alias']) : '';
    // Delete old alias if user erased it.
    if (!empty($path['pid']) && !$path['alias']) {
      path_delete($path['pid']);
    }
    path_node_insert($node);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!path!path.module/function/path_node_update/7.x