Filter to force sitemap.xsl to load via http protocol (rather than https) for http://wordpress.org/plugins/google-sitemap-plugin/
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( 'plugins_url', 'fe_google_sitemap_plugin_https_fix', 10, 3 ); | |
function fe_google_sitemap_plugin_https_fix( $url, $path, $plugin ) { | |
if ( 'sitemap.xsl' !== $url ) { | |
return $url; | |
} | |
if ( 'https://' === substr( $url, 0, 8 ) ) { | |
// the url begins with https, which we do NOT want | |
// change url to start with http instead of https | |
$url = 'http' . substr( $url, 5 ); | |
} | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment