Created
June 5, 2018 07:01
-
-
Save shameemreza/6eed1740d30421de3a4aa9ec84d8a88a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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