mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@52947 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -388,7 +388,7 @@ foreach ( $themes as $theme ) :
|
||||
<div class="theme<?php echo $active_class; ?>">
|
||||
<?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
|
||||
<div class="theme-screenshot">
|
||||
<img src="<?php echo esc_attr( $theme['screenshot'][0] ); ?>" alt="" />
|
||||
<img src="<?php echo esc_attr( $theme['screenshot'][0] . '?ver=' . $theme['version'] ); ?>" alt="" />
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="theme-screenshot blank"></div>
|
||||
@@ -739,7 +739,7 @@ function wp_theme_auto_update_setting_template() {
|
||||
<script id="tmpl-theme" type="text/template">
|
||||
<# if ( data.screenshot[0] ) { #>
|
||||
<div class="theme-screenshot">
|
||||
<img src="{{ data.screenshot[0] }}" alt="" />
|
||||
<img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" />
|
||||
</div>
|
||||
<# } else { #>
|
||||
<div class="theme-screenshot blank"></div>
|
||||
@@ -947,7 +947,7 @@ function wp_theme_auto_update_setting_template() {
|
||||
<div class="theme-about wp-clearfix">
|
||||
<div class="theme-screenshots">
|
||||
<# if ( data.screenshot[0] ) { #>
|
||||
<div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
|
||||
<div class="screenshot"><img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" /></div>
|
||||
<# } else { #>
|
||||
<div class="screenshot blank"></div>
|
||||
<# } #>
|
||||
|
||||
Reference in New Issue
Block a user