Created
February 21, 2016 11:53
-
-
Save dennisblume/7f54a63d2a02f77605d5 to your computer and use it in GitHub Desktop.
Remove query strings from static WordPress resources
This file contains hidden or 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 query strings | |
function _remove_query_strings( $src ){ | |
$rqs = explode( '?ver', $src ); | |
return $rqs[0]; | |
} | |
if ( is_admin() ) { | |
// Remove query strings from static resources disabled in admin | |
} | |
else { | |
add_filter( 'script_loader_src', '_remove_query_strings', 15, 1 ); | |
add_filter( 'style_loader_src', '_remove_query_strings', 15, 1 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment