Skip to content

Instantly share code, notes, and snippets.

@brokkr

brokkr/functions.php

Created Dec 10, 2015
Embed
What would you like to do?
<?php
/**
* 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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment