-
-
Save weszty/98fa6db86932e8458ea9968c2c358b5e to your computer and use it in GitHub Desktop.
Remove query strings
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
<?php | |
// don't copy above line when copying and pasting into your functions.php | |
// Remove WP version number from js and css files. | |
// more exact function, removes also "&" | |
function remove_cssjs_ver( $src ) { | |
if( strpos( $src, '?ver=' ) || strpos( $src, '&ver=' ) ) | |
$src = remove_query_arg( 'ver', $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'remove_cssjs_ver', 15, 1 ); | |
add_filter( 'script_loader_src', 'remove_cssjs_ver', 15, 1 ); | |
// don't copy below line when copying and pasting into your functions.php | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment