From 01a5ae042159dd8c021b6e39279b9119e7ed9b20 Mon Sep 17 00:00:00 2001 From: Justin Kopepasah Date: Wed, 26 Apr 2017 17:07:55 +0900 Subject: [PATCH] 440 Add versioning to enqueued scripts. --- index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index f1cd4778302ae7..ce327d577d9dbf 100644 --- a/index.php +++ b/index.php @@ -159,7 +159,7 @@ function gutenberg_scripts_and_styles( $hook ) { 'wp-editor', plugins_url( 'editor/build/index.js', __FILE__ ), array( 'wp-i18n', 'wp-blocks', 'wp-element' ), - false, // $ver + filemtime( plugin_dir_path( __FILE__ ) . 'editor/build/index.js' ), true // $in_footer ); @@ -212,7 +212,8 @@ function gutenberg_scripts_and_styles( $hook ) { wp_enqueue_style( 'wp-editor', plugins_url( 'editor/build/style.css', __FILE__ ), - array( 'wp-blocks' ) + array( 'wp-blocks' ), + filemtime( plugin_dir_path( __FILE__ ) . 'editor/build/style.css' ) ); } add_action( 'admin_enqueue_scripts', 'gutenberg_scripts_and_styles' );