Created
January 21, 2015 02:08
-
-
Save norcross/8f85522502102461a062 to your computer and use it in GitHub Desktop.
filter content to rewrite image src to https
This file contains hidden or 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 | |
add_filter( 'the_content', 'rkv_force_https_images', 10 ); | |
/** | |
* check image URLs and force https on them | |
* | |
* @param [type] $content [description] | |
*/ | |
function rkv_force_https_images( $content ) { | |
return str_replace( 'src="http://css-tricks.com', 'src="https://css-tricks.com', $content ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment