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
This commit is contained in:
Jonathan Desrosiers 2021-06-25 13:36:02 +00:00
parent 1de9c692f3
commit 4c302c4295
2 changed files with 2 additions and 2 deletions

View File

@ -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' );

View File

@ -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
);
}