On this page
wp_get_original_referer(): string|false
Retrieves original referer that was posted, if it exists.
Return
string|false Original referer URL on success, false on failure.
More Information
HTTP referer is a server variable. ‘referer’ is deliberately miss-spelled.
Source
File: wp-includes/functions.php. View all references
function wp_get_original_referer() {
if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) ) {
return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false );
}
return false;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_validate_redirect() wp-includes/pluggable.php | Validates a URL for use in a redirect. |
| wp_unslash() wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
Used By
| Used By | Description |
|---|---|
| wp_original_referer_field() wp-includes/functions.php | Retrieves or displays original referer hidden field for forms. |
Changelog
| Version | Description |
|---|---|
| 2.0.4 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_original_referer