Changeset 20043
- Timestamp:
- 02/29/2012 08:31:56 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-themes-list-table.php
r20029 r20043 153 153 ?> 154 154 <a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview screenshot"> 155 <?php if ( $ theme->get_screenshot() ) : ?>156 <img src="<?php echo esc_url( $ theme->get_screenshot( 'absolute' )); ?>" alt="" />155 <?php if ( $screenshot = $theme->get_screenshot() ) : ?> 156 <img src="<?php echo esc_url( $screenshot ); ?>" alt="" /> 157 157 <?php endif; ?> 158 158 </a> -
trunk/wp-admin/themes.php
r20029 r20043 100 100 <h3><?php _e( 'Current Theme' ); ?></h3> 101 101 <div id="current-theme"> 102 <?php if ( $ ct->get_screenshot() ) : ?>103 <img src="<?php echo $ct->get_screenshot( 'absolute'); ?>" alt="<?php esc_attr_e( 'Current theme preview'); ?>" />102 <?php if ( $screenshot = $ct->get_screenshot() ) : ?> 103 <img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php esc_attr_e( 'Current theme preview'); ?>" /> 104 104 <?php endif; ?> 105 105 <h4><?php -
trunk/wp-includes/class-wp-theme.php
r20041 r20043 281 281 return $this->get_stylesheet(); 282 282 case 'screenshot' : 283 return $this->get_screenshot( );283 return $this->get_screenshot( 'relative' ); 284 284 // 'author' and 'description' did not previously return translated data. 285 285 case 'description' : … … 361 361 return $this->get_stylesheet_directory(); 362 362 case 'Screenshot' : 363 return $this->get_screenshot( );363 return $this->get_screenshot( 'relative' ); 364 364 case 'Tags' : 365 365 return $this->get('Tags'); … … 793 793 * @access public 794 794 * 795 * @param string $uri Type of URL to include, either relative or absolute. Defaults to relative.795 * @param string $uri Type of URL to include, either 'relative' or an absolute URI. Defaults to absolute URI. 796 796 * @return mixed Screenshot file. False if the theme does not have a screenshot. 797 797 */ 798 public function get_screenshot( $uri = ' relative' ) {798 public function get_screenshot( $uri = 'uri' ) { 799 799 $screenshot = $this->cache_get( 'screenshot' ); 800 800 if ( $screenshot ) { 801 if ( ' absolute' == $uri )802 return $ this->get_stylesheet_directory_uri() . '/' . $screenshot;803 return $ screenshot;801 if ( 'relative' == $uri ) 802 return $screenshot; 803 return $this->get_stylesheet_directory_uri() . '/' . $screenshot; 804 804 } elseif ( 0 === $screenshot ) { 805 805 return false; … … 841 841 // This will set the screenshot cache. 842 842 // If there is no screenshot, the screenshot_count cache will also be set. 843 if ( ! $screenshot = $this->get_screenshot( ) )843 if ( ! $screenshot = $this->get_screenshot( 'relative' ) ) 844 844 return 0; 845 845 … … 869 869 return array(); 870 870 871 $screenshots = array( $this->get_screenshot( ) );871 $screenshots = array( $this->get_screenshot( 'relative' ) ); 872 872 for ( $i = 2; $i <= $count; $i++ ) 873 873 $screenshots[] = 'screenshot-' . $i . '.png'; -
trunk/wp-includes/customize-controls.php
r20031 r20043 29 29 30 30 $theme = wp_get_theme(); 31 $screenshot = $theme->get_screenshot( 'absolute');31 $screenshot = $theme->get_screenshot(); 32 32 33 33 // Let's roll.
Note: See TracChangeset
for help on using the changeset viewer.