Definition:
function wp_safe_redirect($location, $status = 302) {}
Performs a safe (local) redirect, using wp_redirect().
Checks whether the $location is using an allowed host, if it has an absolute path. A plugin can therefore set or remove allowed host(s) to or from the list.
Parameters
- $location
- $status
Return values
returns:Does not return anything
Source code
function wp_safe_redirect($location, $status = 302) {
// Need to look at the URL the way it will end up in wp_redirect()
$location = wp_sanitize_redirect($location);
$location = wp_validate_redirect($location, admin_url());
wp_redirect($location, $status);
}
4071

February 12, 2011 


No comments yet... Be the first to leave a reply!