Created
January 15, 2020 15:47
-
-
Save ColonelMoutarde/a2bef084b19ba17d29159c9a3f45c186 to your computer and use it in GitHub Desktop.
fonctions wordpress
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
/** | |
* @param string $url | |
* @return string|string[] | |
*/ | |
function force_relative_url(string $url) | |
{ | |
return str_replace(get_site_url(), '', $url); | |
} | |
/** | |
* @param string $url | |
* @return string|string[] | |
*/ | |
function force_http_connection_url(string $url) | |
{ | |
return str_replace(get_site_url(), 'http://toto:toto@'.$_SERVER['SERVER_NAME'], $url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment