The version number is included as part of the function so that if the script or stylesheet is updated, the URL changes and caching mechanisms won’t serve an old version.
That said, after having just poked around the deepest, darkest depths of the script loader (and boy is that thing ridiculously complicated), it’s perfectly possible to take out with a couple of filters.
<?
/*
Plugin name: Strip WP Version in Stylesheets/Scripts
*/
add_filter( 'script_loader_src', 'remove_src_version' );
add_filter( 'style_loader_src', 'remove_src_version' );
function remove_src_version ( $src ) {
global $wp_version;
$version_str = '?ver='.$wp_version;
$version_str_offset = strlen( $src ) - strlen( $version_str );
if( substr( $src, $version_str_offset ) == $version_str )
return substr( $src, 0, $version_str_offset );
else
return $src;
}
?>
That was acting up for me, but I’m pretty sure that’s because I’m on a 2.9 dev build that does funky things with the $wp_version
… like not having one. That should strip out the WordPress version from any stylesheets and scripts.