Created
July 22, 2014 06:59
-
-
Save fikrirasyid/0e4e8d72fcee17a2096c to your computer and use it in GitHub Desktop.
Getting 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
/** | |
* Get current URL | |
* | |
* @return string | |
*/ | |
function current_url(){ | |
global $wp; | |
$current_url = trailingslashit( home_url( $wp->request ) ); | |
return $current_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment