Created
March 25, 2015 13:52
-
-
Save mantismamita/d81af526fa6b6f2808f9 to your computer and use it in GitHub Desktop.
Force SSL for media library
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
function have_https_for_media( $url ) { | |
if ( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
} | |
add_filter( 'wp_get_attachment_url', 'have_https_for_media' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment