You are here

function hook_path_insert in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/path/path.api.php \hook_path_insert()

Respond to a path being inserted.

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

1 invocation of hook_path_insert()
path_save in includes/path.inc
Save a path alias to the database.

File

modules/path/path.api.php, line 25
Hooks provided by the Path module.

Code

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