Created
March 7, 2014 08:04
-
-
Save halgatewood/9407345 to your computer and use it in GitHub Desktop.
Update post thumbnails in WordPress with https when needed.
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
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