Make WordPress Core

Changeset 51236


Ignore:
Timestamp:
06/25/2021 01:36:02 PM (5 years ago)
Author:
desrosj
Message:

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.

Location:
trunk/src/wp-content/themes/twentytwentyone/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php

    r49864 r51236  
    114114                        get_theme_file_uri( 'assets/css/custom-color-overrides.css' ),
    115115                        array(),
    116                         (string) filemtime( get_theme_file_path( 'assets/css/custom-color-overrides.css' ) )
     116                        wp_get_theme()->get( 'Version' )
    117117                );
    118118
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-color-control.php

    r49826 r51236  
    5353                        get_theme_file_uri( 'assets/js/palette-colorpicker.js' ),
    5454                        array( 'customize-controls', 'jquery', 'customize-base', 'wp-color-picker' ),
    55                         (string) filemtime( get_theme_file_path( 'assets/js/palette-colorpicker.js' ) ),
     55                        wp_get_theme()->get( 'Version' ),
    5656                        false
    5757                );
Note: See TracChangeset for help on using the changeset viewer.