Last active
January 24, 2018 15:36
-
-
Save farhadhp/ba343d52b22ba72ea076d56e6e233da5 to your computer and use it in GitHub Desktop.
Get current url in wordpress
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
<?php | |
/* | |
* Get current url in wordpress | |
* @return url | |
*/ | |
function get_current_url(){ | |
global $wp; | |
return add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment