Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter to force sitemap.xsl to load via http protocol (rather than https) for http://wordpress.org/plugins/google-sitemap-plugin/
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