pathauto_node_update_alias

  1. drupal
    1. 6 pathauto.module function
    2. 7 pathauto.module function
Drupal 7 pathauto_node_update_alias(stdClass $node, $op, array $options = array())

Update the URL aliases for an individual node.

Parameters

$node: A node object.

$op: Operation being performed on the node ('insert', 'update' or 'bulkupdate').

$options: An optional array of additional options.

5 calls to pathauto_node_update_alias()

File

sites/all/modules/pathauto/pathauto.module, line 489
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_node_update_alias(stdClass $node, $op, array $options = array()) {
  // Skip processing if the user has disabled pathauto for the node.
  if (isset($node->path['pathauto']) && empty($node->path['pathauto'])) {
    return;
  }

  $options += array(
    'language' => !empty($node->language) ? $node->language : LANGUAGE_NONE,
  );

  // Skip processing if the node has no pattern.
  if (!pathauto_pattern_load_by_entity('node', $node->type, $options['language'])) {
    return;
  }

  module_load_include('inc', 'pathauto');
  $uri = entity_uri('node', $node);
  pathauto_create_alias('node', $op, $uri['path'], array('node' => $node), $node->type, $options['language']);
}