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

    r52610 r52947  
    824824                <div class="theme-screenshots">
    825825                <# if ( data.screenshot && data.screenshot[0] ) { #>
    826                     <div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
     826                    <div class="screenshot"><img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" /></div>
    827827                <# } else { #>
    828828                    <div class="screenshot blank"></div>
Note: See TracChangeset for help on using the changeset viewer.