wp_validate_redirect
wp_validate_redirect ( $location, $fallback_url = '' )
Parameters:- (string) location The redirect to validate.
- (string) fallback_url The value to return if $location is not allowed.
Returns:- (string) Redirect-sanitized URL.
Defined at: - Introduced in WordPress: 2.8.1
- Deprecated in WordPress: —
Description
Validates a URL for use in a 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.
If the host is not allowed, then the redirect is to $fallback_url supplied.