function pathauto_node_update_alias in Pathauto 6
Same name and namespace in other branches
- 6.2 pathauto.module \pathauto_node_update_alias()
- 7 pathauto.module \pathauto_node_update_alias()
Update the URL aliases for an individual node.
Parameters
$node: A node object.
$op: Operation being performed on the node ('insert', 'update' or 'bulkupdate').
2 calls to pathauto_node_update_alias()
- PathautoUnitTestCase::testUpdateActions in ./
pathauto.test - Test the different update actions in pathauto_create_alias().
- pathauto_node_update_alias_multiple in ./
pathauto.module - Update the URL aliases for multiple nodes.
File
- ./
pathauto.module, line 423 - Main file for the Pathauto module, which automatically generates aliases for content.
Code
function pathauto_node_update_alias($node, $op) {
module_load_include('inc', 'pathauto');
$placeholders = pathauto_get_placeholders('node', $node);
if ($alias = pathauto_create_alias('node', $op, $placeholders, "node/{$node->nid}", $node->nid, $node->type, $node->language)) {
$node->path = $alias;
}
}