wp_validate_redirect


wp_validate_redirect ( $location, $default = '' )

Parameters:
  • (string) $location The redirect to validate
  • (string) $default The value to return if $location is not allowed
Returns:
  • (string) redirect-sanitized URL
Defined at:

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 $default supplied

Related Functions

wp_sanitize_redirect, wp_safe_redirect, wp_redirect, wp_old_slug_redirect, wp_validate_site_data

Top Google Results

User discussions

wpseek mobile