Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Created January 24, 2015 19:53
Show Gist options
  • Save ericakfranz/a7f172fd63aaf01ede4c to your computer and use it in GitHub Desktop.
Save ericakfranz/a7f172fd63aaf01ede4c to your computer and use it in GitHub Desktop.
Remove version query string from WordPress files.
//* Remove version number from js and css files, keep other variables intact.
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment