WordPress plugin that replaces http: with https: in any content containing the home URL wherever found in content requested via https.
https://gist.github.com/curt/e867346acb33a1d24c8fc1e79f416e37
Curt Gilman
https://af7kq.com/
WordPress plugin that replaces http: with https: in any content containing the home URL wherever found in content requested via https.
https://gist.github.com/curt/e867346acb33a1d24c8fc1e79f416e37
Curt Gilman
https://af7kq.com/
<?php | |
/** | |
* Plugin Name: AF7KQ Replace Home URLs | |
* Plugin URI: https://gist.github.com/curt/e867346acb33a1d24c8fc1e79f416e37 | |
* Description: Replaces http: URL containing the home URL with https: URL | |
* Version: 0.0.1 | |
* Author: Curt Gilman | |
* Author URI: https://af7kq.com/ | |
*/ | |
add_filter( 'the_content', 'af7kq_filter_replace_home_urls' ); | |
function af7kq_filter_replace_home_urls( $content ) { | |
if( is_ssl() ) { | |
$content = str_replace( set_url_scheme( home_url(), 'http' ), set_url_scheme( home_url(), 'https' ), $content); | |
} | |
return $content; | |
} | |
?> |