Make WordPress Core


Ignore:
Timestamp:
03/17/2022 10:19:58 PM (3 years ago)
Author:
audrasjb
Message:

Themes: Add version to theme screenshot URL for better browser cache handling.

This change appends the theme version number to the URL of screenshots that appear in various place of the WordPress Admin. As a result, browsers will be able to refresh the screenshot as needed when the theme is updated.

Props codente, desrosj, audrasjb, SergeyBiryukov.
Fixes #53370.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-theme-control.php

    r52371 r52947  
    7575            <# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>
    7676                <div class="theme-screenshot">
    77                     <img data-src="{{ data.theme.screenshot[0] }}" alt="" />
     77                    <img data-src="{{ data.theme.screenshot[0] }}?ver={{ data.theme.version }}" alt="" />
    7878                </div>
    7979            <# } else { #>
Note: See TracChangeset for help on using the changeset viewer.