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/update-core.php

    r52644 r52947  
    756756        </td>
    757757        <td class="plugin-title"><p>
    758             <img src="<?php echo esc_url( $theme->get_screenshot() ); ?>" width="85" height="64" class="updates-table-screenshot" alt="" />
     758            <img src="<?php echo esc_url( $theme->get_screenshot() . '?ver=' . $theme->version ); ?>" width="85" height="64" class="updates-table-screenshot" alt="" />
    759759            <strong><?php echo $theme->display( 'Name' ); ?></strong>
    760760            <?php
Note: See TracChangeset for help on using the changeset viewer.