Created
April 13, 2019 08:15
-
-
Save tuanbbhero/8bd4c275817f91c457da4b3eb72816c3 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
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