Created
August 22, 2014 14:17
-
-
Save timstl/7c3d017a0f215158676a to your computer and use it in GitHub Desktop.
maybe_ssl_url (for 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
function maybe_ssl_url($url) | |
{ | |
if (!is_ssl()) { return $url; } | |
return str_ireplace('http://', 'https://', $url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment