Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Force WordPress Media button to insert https links
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