mantismamita
3/25/2015 - 1:52 PM

Force SSL for media library

Force SSL for media library

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' );