Skip to content

Instantly share code, notes, and snippets.

@joelstransky
Created February 26, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelstransky/24cc93b88687073d99a3 to your computer and use it in GitHub Desktop.
Save joelstransky/24cc93b88687073d99a3 to your computer and use it in GitHub Desktop.
Get referer url in wordpress
// 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