Created
March 1, 2016 16:11
-
-
Save jamesmorrison/ee81d3e2ac06833a18a4 to your computer and use it in GitHub Desktop.
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
<?php | |
/* | |
* Force URLs in srcset attributes into HTTPS scheme. | |
*/ | |
add_filter( 'wp_calculate_image_srcset', function( $sources ) { | |
foreach ( $sources as &$source ) { | |
$source['url'] = set_url_scheme( $source['url'], 'https' ); | |
} | |
return $sources; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment