Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function hook_path_update

Same name and namespace in other branches
  1. 8.9.x core/modules/path/path.api.php \hook_path_update()

Respond to a path being updated.

Parameters

$path: An associative array containing the following keys:

  • source: The internal system path.
  • alias: The URL alias.
  • pid: Unique path alias identifier.
  • language: The language of the alias.

See also

path_save()

Related topics

Hooks
Allow modules to interact with the Drupal core.
1 function implements hook_path_update()

Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.

path_test_path_update in modules/simpletest/tests/path_test.module
Implements hook_path_update().
1 invocation of hook_path_update()
path_save in includes/path.inc
Save a path alias to the database.

File

modules/path/path.api.php, line 46

Code

function hook_path_update ($path) {
 db_update ('mytable')->fields (array(
 'alias' => $path['alias'],
 ))
 ->condition ('pid', $path['pid'])
 ->execute ();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.