WordPress at a glance

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.

Basis of: 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.5.1

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

From category: Uncategorized

No comments
    Log In . Register