Skip to content

Instantly share code, notes, and snippets.

@timstl

timstl/maybe_ssl_url

Created Aug 22, 2014
Embed
What would you like to do?
maybe_ssl_url (for WordPress)
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