Skip to content

Instantly share code, notes, and snippets.

@salcode
Created April 24, 2014 17:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save salcode/11262079 to your computer and use it in GitHub Desktop.
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