Skip to content

Instantly share code, notes, and snippets.

@timstl
Created August 22, 2014 14:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timstl/7c3d017a0f215158676a to your computer and use it in GitHub Desktop.
Save timstl/7c3d017a0f215158676a to your computer and use it in GitHub Desktop.
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