Last active
December 23, 2015 12:25
-
-
Save eltondev/e2ceb77e70b1dc0c0b2d to your computer and use it in GitHub Desktop.
Remove Version CSS and JS
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
function wp_remove_script_version( $src ){ | |
$parts = explode( '?', $src ); | |
return $parts[0]; | |
} | |
add_filter( 'script_loader_src', 'wp_remove_script_version', 15, 1 ); | |
add_filter( 'style_loader_src' , 'wp_remove_script_version', 15, 1 ); | |
function hide_wp_version($src) { | |
global $wp_version; | |
return str_replace('?ver=$wp_version', $src); | |
} | |
add_filter('script_loader_src', 'hide_wp_version'); | |
add_filter('style_loader_src', 'hide_wp_version'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment