You are here

function redirect_path_alias_insert in Redirect 8

Implements hook_ENTITY_TYPE_insert() for path_alias.

File

./redirect.module, line 117
The redirect module.

Code

function redirect_path_alias_insert(PathAliasInterface $path_alias) {

  // Delete all redirects having the same source as this alias.
  redirect_delete_by_path($path_alias
    ->getAlias(), $path_alias
    ->language()
    ->getId(), FALSE);
}