Created
January 23, 2018 11:36
-
-
Save davidcraig/aa4ccf57cfa8c49199cf4d945b0675ab to your computer and use it in GitHub Desktop.
WordPress - Remove version number from enqueued scripts/styles.
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 param from any enqueued scripts | |
function enqueueRemoveWpVersion($src) { | |
if ( strpos($src, 'ver=')) | |
$src = remove_query_arg( 'ver', $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'enqueueRemoveWpVersion', 9999 ); | |
add_filter( 'script_loader_src', 'enqueueRemoveWpVersion', 9999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist removes all version numbers from wordpress enqueued assets.