You are here

function redirect_delete_by_entity_path in Redirect 7.2

Same name and namespace in other branches
  1. 7 redirect.module \redirect_delete_by_entity_path()

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.

Related topics

1 call to redirect_delete_by_entity_path()
redirect_entity_delete in ./redirect.module
Implements hook_entity_delete().

File

./redirect.module, line 975

Code

function redirect_delete_by_entity_path($entity_type, $entity) {
  $uri = entity_uri($entity_type, $entity);
  if (!empty($uri['path'])) {
    redirect_delete_by_path($uri['path']);
  }

  //$info = entity_get_info($entity_type);

  //if (isset($info['default path'])) {

  //  list($id) = entity_extract_ids($entity_type, $entity);
  //  $default_path = str_replace('[id]', $id, $info['default path']);
  //  if ($uri['path'] !== $default_path) {
  //    redirect_delete_by_path($default_path);
  //  }

  //}
}