-
-
Save krishna19/010e8e02a6a78b89999d3998f20c4266 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; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment