From 67a2b356312280688fea7e82bebcbba73da1a90c Mon Sep 17 00:00:00 2001 From: Stuart Bermingham Date: Wed, 30 Sep 2020 12:11:23 +1300 Subject: [PATCH] Use the css/js file last modified time as the version so that users won't see old cached versions when they've been updated. --- theme-customisations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme-customisations.php b/theme-customisations.php index c5e3ff8..03f3cd0 100755 --- a/theme-customisations.php +++ b/theme-customisations.php @@ -50,7 +50,7 @@ public function theme_customisations_setup() { * @return void */ public function theme_customisations_css() { - wp_enqueue_style( 'custom-css', plugins_url( '/custom/style.css', __FILE__ ) ); + wp_enqueue_style( 'custom-css', plugins_url( '/custom/style.css', __FILE__ ), '', filemtime(__DIR__ . '/custom/style.css') ); } /** @@ -59,7 +59,7 @@ public function theme_customisations_css() { * @return void */ public function theme_customisations_js() { - wp_enqueue_script( 'custom-js', plugins_url( '/custom/custom.js', __FILE__ ), array( 'jquery' ) ); + wp_enqueue_script( 'custom-js', plugins_url( '/custom/custom.js', __FILE__ ), array( 'jquery' ), filemtime(__DIR__ . '/custom/custom.js') ); } /**