You are here

function redirect_load in Redirect 7

Same name and namespace in other branches
  1. 7.2 redirect.module \redirect_load()

Load an URL redirect from the database.

Parameters

$rid: The URL redirect ID.

$reset: Whether to reset the redirect_load_multiple cache.

Return value

An URL redirect object, or FALSE if loading failed.

Related topics

5 calls to redirect_load()
RedirectFunctionalTest::testDisableEnableRedirect in ./redirect.test
RedirectTestHelper::assertRedirect in ./redirect.test
redirect_handler_field_redirect_link_delete::render in views/redirect_handler_field_redirect_link_delete.inc
Render the field.
redirect_handler_field_redirect_link_edit::render in views/redirect_handler_field_redirect_link_edit.inc
Render the field.
redirect_handler_field_redirect_operations::render in views/redirect_handler_field_redirect_operations.inc
Render the field.
1 string reference to 'redirect_load'
redirect_hook_info in ./redirect.module
Implements hook_hook_info().

File

./redirect.module, line 538

Code

function redirect_load($rid, $reset = FALSE) {
  $redirects = entity_load('redirect', array(
    $rid,
  ), array(), $reset);
  if (!empty($redirects)) {
    drupal_alter('redirect_load', $redirects);
    return !empty($redirects) ? reset($redirects) : FALSE;
  }
  return FALSE;
}