WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp sanitize redirect

Description

Sanitizes a URL for use in a redirect. Removes invalid URL characters in the URL parameter.

Parameters

$location
(string) (required) URL of the link to redirect to.
Default: None

Return Values

(string) 
redirect-sanitized URL

Change Log

Since: 2.3

Source File

wp_sanitize_redirect() is located in wp-includes/pluggable.php