Last active
May 7, 2018 14:59
-
-
Save spigotdesign/0f0c0ecfeb838017555d17a71c0fe915 to your computer and use it in GitHub Desktop.
Force WordPress Media button to insert https links
This file contains 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
add_filter( ‘image_send_to_editor’, ‘force_protocol_relative’, 10, 9 ); | |
function force_protocol_relative($content) { | |
$content = str_replace( ‘http://’, ‘https://’, $content ); | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment