A WordPress-centric search engine for devs and theme authors



wp_get_raw_referer ›

Since4.5.0
Deprecatedn/a
wp_get_raw_referer ( No parameters )
Returns:
  • (string|false) Referer URL on success, false on failure.
Defined at:
Codex:

Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.

Do not use for redirects, use wp_get_referer() instead.



Source

function wp_get_raw_referer() {
	if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
		return wp_unslash( $_REQUEST['_wp_http_referer'] );
	} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
		return wp_unslash( $_SERVER['HTTP_REFERER'] );
	}

	return false;
}