WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/13/2009 07:06:35 PM (12 years ago)
Author:
markjaquith
Message:

Introducing register_theme_directory() which takes a wp-content-relative path and will additionally scan it for themes. Plugins can use this to add themes without requiring copying by the user. props apeatling. fixes #10467

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/themes.php

    r11761 r12025  
    133133<div id="current-theme">
    134134<?php if ( $ct->screenshot ) : ?>
    135 <img src="<?php echo content_url($ct->stylesheet_dir . '/' . $ct->screenshot); ?>" alt="<?php _e('Current theme preview'); ?>" />
     135<img src="<?php echo $ct->theme_root_uri . '/' . $ct->stylesheet . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
    136136<?php endif; ?>
    137137<h4><?php
     
    140140<p class="theme-description"><?php echo $ct->description; ?></p>
    141141<?php if ($ct->parent_theme) { ?>
    142     <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p>
     142    <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?></p>
    143143<?php } else { ?>
    144     <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?></p>
     144    <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ) ); ?></p>
    145145<?php } ?>
    146146<?php if ( $ct->tags ) : ?>
     
    204204    $template_dir = $themes[$theme_name]['Template Dir'];
    205205    $parent_theme = $themes[$theme_name]['Parent Theme'];
     206    $theme_root = $themes[$theme_name]['Theme Root'];
     207    $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
    206208    $preview_link = esc_url(get_option('home') . '/');
    207209    if ( is_ssl() )
     
    224226        <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
    225227<?php if ( $screenshot ) : ?>
    226             <img src="<?php echo content_url($stylesheet_dir . '/' . $screenshot); ?>" alt="" />
     228            <img src="<?php echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot; ?>" alt="" />
    227229<?php endif; ?>
    228230        </a>
     
    234236    <?php if ($parent_theme) {
    235237    /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
    236     <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $title, $template_dir, $stylesheet_dir, $title, $parent_theme); ?></p>
     238    <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?></p>
    237239<?php } else { ?>
    238     <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, $template_dir, $stylesheet_dir); ?></p>
     240    <p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?></p>
    239241<?php } ?>
    240242<?php if ( $tags ) : ?>
Note: See TracChangeset for help on using the changeset viewer.