Last active
March 27, 2018 07:14
-
-
Save thomasmb/6380294 to your computer and use it in GitHub Desktop.
Simple filter for adding https support to wp_get_attachment_url in WordPress
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( 'wp_get_attachment_url', function( $url, $id ){ | |
if( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
}); |
Aternus
commented
Dec 14, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment