Created
March 2, 2020 14:49
-
-
Save jrobinsonc/7815839a3dc1bc099266f4d5ef0b7931 to your computer and use it in GitHub Desktop.
Wordpress helper: Get current URL
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
<?php | |
/** | |
* Returns the current url. | |
* | |
* @return string | |
*/ | |
function get_current_url() { | |
global $wp; | |
return home_url( $wp->request ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment