Created
February 26, 2016 20:04
-
-
Save joelstransky/24cc93b88687073d99a3 to your computer and use it in GitHub Desktop.
Get referer url in wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// because $_SERVER['HTTP_REFERER'] is unreliable | |
function get_referer() { | |
$scheme = is_ssl() ? 'https' : 'http'; | |
return $scheme . "://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment