Created
May 20, 2019 06:21
-
-
Save kowsar89/8ba13ebdcd7797cce32192ba1ee725c9 to your computer and use it in GitHub Desktop.
Apply dynamic version number in all css and js files
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
<?php | |
// Apply dynamic version number in all css and js files | |
add_filter( 'script_loader_src', 'k_script_dynamic_ver_num', 150 ); | |
add_filter( 'style_loader_src', 'k_script_dynamic_ver_num', 150); | |
function k_script_dynamic_ver_num( $src ){ | |
return add_query_arg( 'ver', time(), $src ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment