From 4c302c4295b9be36d490dea6fbcb6ee7a974e7c8 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 25 Jun 2021 13:36:02 +0000 Subject: [PATCH] Twenty Twenty-One: Use the theme version when enqueueing theme assets. This avoids having to interact with the filesystem and ensures browser and proxy caches are only cleared when the file is actually updated. Props peterwilsoncc, ryelle, aristath, SergeyBiryukov. Fixes #53502. git-svn-id: https://develop.svn.wordpress.org/trunk@51236 602fd350-edb4-49c9-b593-d223f7449a82 --- .../classes/class-twenty-twenty-one-custom-colors.php | 2 +- .../classes/class-twenty-twenty-one-customize-color-control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php index ad02f4e0eb..897ef53617 100644 --- a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php +++ b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php @@ -113,7 +113,7 @@ class Twenty_Twenty_One_Custom_Colors { 'twenty-twenty-one-custom-color-overrides', get_theme_file_uri( 'assets/css/custom-color-overrides.css' ), array(), - (string) filemtime( get_theme_file_path( 'assets/css/custom-color-overrides.css' ) ) + wp_get_theme()->get( 'Version' ) ); $background_color = get_theme_mod( 'background_color', 'D1E4DD' ); diff --git a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-color-control.php b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-color-control.php index 818147209d..f2c924e5a4 100644 --- a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-color-control.php +++ b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-color-control.php @@ -52,7 +52,7 @@ class Twenty_Twenty_One_Customize_Color_Control extends WP_Customize_Color_Contr 'twentytwentyone-control-color', get_theme_file_uri( 'assets/js/palette-colorpicker.js' ), array( 'customize-controls', 'jquery', 'customize-base', 'wp-color-picker' ), - (string) filemtime( get_theme_file_path( 'assets/js/palette-colorpicker.js' ) ), + wp_get_theme()->get( 'Version' ), false ); }