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-admin/theme-install.php

    r52819 r52947  
    283283    <# if ( data.screenshot_url ) { #>
    284284        <div class="theme-screenshot">
    285             <img src="{{ data.screenshot_url }}" alt="" />
     285            <img src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
    286286        </div>
    287287    <# } else { #>
     
    457457                    </span>
    458458
    459                     <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
     459                    <img class="theme-screenshot" src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
    460460
    461461                    <div class="theme-details">
Note: See TracChangeset for help on using the changeset viewer.