Created
October 23, 2017 11:15
-
-
Save rotisoft/06002b0585f33fa45b4ab6a65d841d3b to your computer and use it in GitHub Desktop.
WordPress srcset https redirect
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_srcset( $sources ) { | |
foreach ( $sources as &$source ) { | |
$source['url'] = set_url_scheme( $source['url'], 'https' ); | |
} | |
return $sources; | |
} | |
add_filter( 'wp_calculate_image_srcset', 'ssl_srcset' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment