Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
WordPress: Removes the version parameter from the script URI for the Google CDN.
<?php
// for the functions.php
add_filter('script_loader_src', 'toscho_script_loader_filter');
/**
* Removes the version parameter from the script URI for the Google CDN.
*
* @param string $src Original script URI
* @return string
*/
function toscho_script_loader_filter($src)
{
// Not our business.
if ( FALSE === strpos($src, 'http://ajax.googleapis.com/') )
{
return $src;
}
// Separate the version parameter.
$new_src = explode('?', $src);
// Just the URI without the query string.
return $new_src[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.