wp_sanitize_redirect() WP 1.0
Sanitizes a URL for use in a redirect.
This is a pluggable function, and it can be replaced by a plugin. It means that this function is defined (works) only after all plugins are loaded (included), but before this moment this function has not defined. Therefore, you cannot call this and all functions depended on this function directly from a plugin code. They need to be called on plugins_loaded hook or later, for example on init hook.
Function replacement (override) — in a plugin you can create a function with the same name, then it replace this function.
Works based on: wp_kses_no_null()
Basis of: wp_safe_redirect()
1 time = 0.000309s = fast | 50000 times = 0.20s = very fast | PHP 7.1.5, WP 4.8.2
No Hooks.
Return
String. Redirect-sanitized URL.
Usage
wp_sanitize_redirect( $location );
- $location(string) (required)
- The path to redirect to.
Changelog
Since 2.3.0 | Introduced. |