WordPress at Your Fingertips

wp_get_raw_referer() WP 1.0

Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.

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

Used By: wp_get_referer()

No Hooks.

Return

String|false. Referer URL on success, false on failure.

Usage

wp_get_raw_referer();

Changelog

Since 4.5.0 Introduced.

Code of wp_get_raw_referer() WP 5.8.1

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

Uncategorized

No comments
    Log In