Ticket #18599: 18599.2.patch
File 18599.2.patch, 2.6 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-themes-list-table.php
175 175 ?> 176 176 <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot"> 177 177 <?php if ( $screenshot ) : ?> 178 <img src="<?php echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot; ?>" alt="" />178 <img src="<?php echo esc_url( _get_theme_screenshot_url( $theme_root, $theme_root_uri, $template, $stylesheet, $screenshot ) ); ?>" alt="" /> 179 179 <?php endif; ?> 180 180 </a> 181 181 <h3><?php -
wp-admin/themes.php
81 81 <h3><?php _e('Current Theme'); ?></h3> 82 82 <div id="current-theme"> 83 83 <?php if ( $ct->screenshot ) : ?> 84 <img src="<?php echo $ct->theme_root_uri . '/' . $ct->stylesheet . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />84 <img src="<?php echo esc_url( _get_theme_screenshot_url( $ct->theme_root, $ct->theme_root_uri, $ct->template, $ct->stylesheet, $ct->screenshot ) ); ?>" alt="<?php _e('Current theme preview'); ?>" /> 85 85 <?php endif; ?> 86 86 <h4><?php 87 87 /* translators: 1: theme title, 2: theme version, 3: theme author */ -
wp-includes/theme.php
295 295 296 296 $screenshot = false; 297 297 foreach ( array('png', 'gif', 'jpg', 'jpeg') as $ext ) { 298 if ( file_exists("$theme_root/$stylesheet/screenshot.$ext")) {298 if ( file_exists("$theme_root/$stylesheet/screenshot.$ext") || file_exists("$theme_root/$template/screenshot.$ext") ) { 299 299 $screenshot = "screenshot.$ext"; 300 300 break; 301 301 } … … 1989 1989 1990 1990 add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); 1991 1991 1992 /** 1993 * Retrieve screenshot URL for a theme. 1994 * 1995 * If a child theme screenshot is missing, the one from a parent theme is used. 1996 * 1997 * @access private 1998 * @since 3.3.0 1999 */ 2000 function _get_theme_screenshot_url( $theme_root, $theme_root_uri, $template, $stylesheet, $screenshot ) { 2001 $screenshot_url = false; 2002 2003 if ( file_exists("$theme_root/$stylesheet/$screenshot") ) 2004 $screenshot_url = "$theme_root_uri/$stylesheet/$screenshot"; 2005 elseif ( file_exists("$theme_root/$template/$screenshot") ) 2006 $screenshot_url = "$theme_root_uri/$template/$screenshot"; 2007 2008 return $screenshot_url; 2009 } 2010 1992 2011 ?>