W3cubDocs

/WordPress

wp_get_original_referer()

Retrieve original referer that was posted, if it exists.

Description

Return

(string|false) False if no original referer or original referer if set.

Source

File: wp-includes/functions.php

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;
}

Changelog

Version Description
2.0.4 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_original_referer