wordpress enqueue style cache busting code example
Example: wordpress enqueue script cache busting
function my_load_scripts($hook) {
$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');