Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Created March 7, 2014 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halgatewood/9407345 to your computer and use it in GitHub Desktop.
Save halgatewood/9407345 to your computer and use it in GitHub Desktop.
Update post thumbnails in WordPress with https when needed.
function ssl_post_thumbnail_html( $html )
{
if( is_ssl() )
{
return str_replace("http://", "https://", $html);
}
else
{
return $html;
}
}
add_filter('post_thumbnail_html', 'ssl_post_thumbnail_html');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment