path_redirect_delete($from = NULL, $to = NULL, $rid = NULL)
contributions/path_redirect/path_redirect.module, line 173
Delete the specified path redirect. This will delete as specifically as possible, in order: by $rid, by ($from, $to), by $from, or by $to. Multiple redirects may be deleted if the $to parameter matches more than one entry.
This function is part of an API available for external code to use.
$from Source path of redirect to delete.
$to Destination path or URL of redirect to delete.
$rid Unique ID of redirect to delete.
The result of the deletion query.
<?php
function path_redirect_delete($from = NULL, $to = NULL, $rid = NULL) {
if (!empty($rid)) {
$result = db_query("DELETE FROM {path_redirect} WHERE rid = %d", $rid);
}
else if (!empty($from)) {
if (!empty($to)) {
$result = db_query("DELETE FROM {path_redirect} WHERE path = '%s' AND redirect = '%s'", $from, $to);
}
else {
$result = db_query("DELETE FROM {path_redirect} WHERE path = '%s'", $from);
}
}
else if (!empty($to)) {
$result = db_query("DELETE FROM {path_redirect} WHERE redirect = '%s'", $to);
}
return $result;
}
?>