Advertisements

wp_get_referer

Definition:
function wp_get_referer() {}

Retrieve referer from ‘_wp_http_referer’ or HTTP referer. If it’s the same as the current request URL, will return false.

Return values

returns:False on failure. Referer URL on success.

Source code

function wp_get_referer() {

	$ref = false;

	if ( ! empty( $_REQUEST['_wp_http_referer'] ) )

		$ref = $_REQUEST['_wp_http_referer'];

	else if ( ! empty( $_SERVER['HTTP_REFERER'] ) )

		$ref = $_SERVER['HTTP_REFERER'];



	if ( $ref && $ref !== $_SERVER['REQUEST_URI'] )

		return $ref;

	return false;

}

3743

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: