WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp sanitize redirect

Contents

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