Skip to content

Instantly share code, notes, and snippets.

@tuanbbhero
Created April 13, 2019 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuanbbhero/8bd4c275817f91c457da4b3eb72816c3 to your computer and use it in GitHub Desktop.
Save tuanbbhero/8bd4c275817f91c457da4b3eb72816c3 to your computer and use it in GitHub Desktop.
function remove_query_strings() {
if(!is_admin()) {
add_filter('script_loader_src', 'remove_query_strings_split', 15);
add_filter('style_loader_src', 'remove_query_strings_split', 15);
}
}
function remove_query_strings_split($src){
$output = preg_split("/(&ver|\?ver)/", $src);
return $output[0];
}
add_action('init', 'remove_query_strings');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment