1 path.inc path_delete($criteria)

Delete a URL alias.

Parameters

$criteria: A number representing the pid or an array of criteria.

File

core/includes/path.inc, line 462
Functions to handle paths in Backdrop, including path aliasing.

Code

function path_delete($criteria) {
  if (!is_array($criteria)) {
    $criteria = array('pid' => $criteria);
  }
  // Load and then delete each path until there are no more aliases left.
  while ($path = path_load($criteria)) {
    module_invoke_all('path_delete', $path);
    backdrop_clear_path_cache($path['source']);
    db_delete('url_alias')->condition('pid', $path['pid'])->execute();
  }
}