Created
February 12, 2020 11:59
-
-
Save Farmatique/938f5168469e0685e2c4eba05412fbb7 to your computer and use it in GitHub Desktop.
Get current url inside wordpress (php)
This file contains hidden or 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
function current_url() | |
{ | |
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
$validURL = str_replace("&", "&", $url); | |
return $validURL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment