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.


Built from https://develop.svn.wordpress.org/trunk@52947


git-svn-id: http://core.svn.wordpress.org/trunk@52536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb
2022-03-17 22:21:07 +00:00
parent d6589948ca
commit a32545f854
7 changed files with 11 additions and 11 deletions

View File

@@ -74,7 +74,7 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>
<div class="theme-screenshot">
<img data-src="{{ data.theme.screenshot[0] }}" alt="" />
<img data-src="{{ data.theme.screenshot[0] }}?ver={{ data.theme.version }}" alt="" />
</div>
<# } else { #>
<div class="theme-screenshot blank"></div>