Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Remove WP version strings from scripts and styles
function shameem_remove_wp_version_strings( $src ) {
global $wp_version;
parse_str(parse_url($src, PHP_URL_QUERY), $query);
if ( !empty($query['ver']) && $query['ver'] === $wp_version ) {
$src = remove_query_arg('ver', $src);
}
return $src;
}
add_filter( 'script_loader_src', 'shameem_remove_wp_version_strings' );
add_filter( 'style_loader_src', 'shameem_remove_wp_version_strings' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment