Created
November 6, 2016 07:51
-
-
Save iliman/e82e1c0108192f51984b7efea7e4b970 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
/** | |
* Never worry about cache again! | |
*/ | |
function my_load_scripts($hook) { | |
// create my own version codes | |
$my_js_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/custom.js' )); | |
$my_css_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )); | |
// | |
wp_enqueue_script( 'custom_js', plugins_url( 'js/custom.js', __FILE__ ), array(), $my_js_ver ); | |
wp_register_style( 'my_css', plugins_url( 'style.css', __FILE__ ), false, $my_css_ver ); | |
wp_enqueue_style ( 'my_css' ); | |
} | |
add_action('wp_enqueue_scripts', 'my_load_scripts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment