Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple filter for adding https support to wp_get_attachment_url in WordPress
<?php
add_filter( 'wp_get_attachment_url', function( $url, $id ){
if( is_ssl() )
$url = str_replace( 'http://', 'https://', $url );
return $url;
});
@Aternus

This comment has been minimized.

Copy link

@Aternus Aternus commented Dec 14, 2014

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.