Skip to content

Instantly share code, notes, and snippets.

@dejanmarkovic
Created February 22, 2014 16:02
Show Gist options
  • Save dejanmarkovic/9157151 to your computer and use it in GitHub Desktop.
Save dejanmarkovic/9157151 to your computer and use it in GitHub Desktop.
Mixed Content Fixer
<?php
/* Plugin Name: Mixed Content Fixer
* Description: This simple plug-in is replacing the url's in content from http to https.
* Author: Leo Seccia & Dejan Markovic
* Version: 2014.1.0
*/
add_filter('the_content', 'content_fix');
function content_fix($content)
{
if (is_ssl()) {
return str_replace("http://", "https://", $content);
}
else
{
return $content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment