You are here

function pathauto_entity_path_delete_all in Pathauto 7

Delete an entity URL alias and any of its sub-paths.

This function also checks to see if the default entity URI is different from the current entity URI and will delete any of the default aliases.

Parameters

$entity_type: A string with the entity type.

$entity: An entity object.

$default_uri: The optional default uri path for the entity.

3 calls to pathauto_entity_path_delete_all()
pathauto_node_delete in ./pathauto.module
Implements hook_node_delete().
pathauto_taxonomy_term_delete in ./pathauto.module
Implements hook_taxonomy_term_delete().
pathauto_user_delete in ./pathauto.module
Implements hook_user_delete().

File

./pathauto.module, line 201
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_entity_path_delete_all($entity_type, $entity, $default_uri = NULL) {
  $uri = entity_uri($entity_type, $entity);
  pathauto_path_delete_all($uri['path']);
  if (isset($default_uri) && $uri['path'] != $default_uri) {
    pathauto_path_delete_all($default_uri);
  }
}