WordPress.org

Make WordPress Core

Ticket #6938: theme_screenshots_fix.patch

File theme_screenshots_fix.patch, 1.9 KB (added by sambauers, 10 years ago)

Fixes theme screenshots in admin

  • wp-includes/theme.php

     
    128128        $themes = array();
    129129        $wp_broken_themes = array();
    130130        $theme_loc = $theme_root = get_theme_root();
    131         if ( '/' != ABSPATH ) // don't want to replace all forward slashes, see Trac #4541
    132                 $theme_loc = str_replace(ABSPATH, '', $theme_root);
     131        if ( '/' != WP_CONTENT_DIR ) // don't want to replace all forward slashes, see Trac #4541
     132                $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root);
    133133
    134134        // Files in wp-content/themes directory and one subdir down
    135135        $themes_dir = @ opendir($theme_root);
  • wp-admin/themes.php

     
    5757<h2><?php _e('Current Theme'); ?></h2>
    5858<div id="current-theme">
    5959<?php if ( $ct->screenshot ) : ?>
    60 <img src="<?php echo site_url($ct->stylesheet_dir . '/' . $ct->screenshot); ?>" alt="<?php _e('Current theme preview'); ?>" />
     60<img src="<?php echo WP_CONTENT_URL . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
    6161<?php endif; ?>
    6262<h3><?php printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author) ; ?></h3>
    6363<p class="description"><?php echo $ct->description; ?></p>
     
    126126?>
    127127                <a href="<?php echo $activate_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
    128128<?php if ( $screenshot ) : ?>
    129                         <img src="<?php echo ( $tpage == 'stage' ) ? $screenshot : site_url($stylesheet_dir . '/' . $screenshot); ?>" alt="" />
     129                        <img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
    130130<?php endif; ?>
    131131                </a>
    132132                <h3><a class="<?php echo $thickbox_class; ?>" href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>