WordPress.org

Make WordPress Core

Changeset 16714


Ignore:
Timestamp:
12/04/2010 03:52:59 AM (9 years ago)
Author:
nacin
Message:

Don't even show parent theme files when viewing the child theme. see #15672.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/theme-editor.css

    r14625 r16714  
    1 #template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
     1h3 span{font-weight:normal;}#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
  • trunk/wp-admin/css/theme-editor.dev.css

    r14625 r16714  
     1h3 span {
     2    font-weight: normal;
     3}
     4
    15#template textarea {
    26    font-family: Consolas, Monaco, Courier, monospace;
  • trunk/wp-admin/theme-editor.php

    r16712 r16714  
    126126
    127127$description = get_file_description($file);
    128 $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (%s)" : "%s";
     128$desc_header = ( $description != $file_show ) ? "$description <span>(%s)</span>" : "<span>%s</span>";
     129
     130$is_child_theme = $themes[$theme]['Template'] != $themes[$theme]['Stylesheet'];
    129131?>
    130132<div class="wrap">
     
    134136<div class="fileedit-sub">
    135137<div class="alignleft">
    136 <big><?php echo sprintf($desc_header, $file_show); ?></big>
     138<h3><?php
     139if ( $is_child_theme && strpos( $file, $themes[$theme]['Template Dir'] ) === 0 )
     140    echo $themes[$theme]['Parent Theme'] . ': ';
     141else
     142    echo $themes[$theme]['Name'] . ': ';
     143printf( $desc_header, $file_show ); ?></h3>
    137144</div>
    138145<div class="alignright">
     
    156163</div>
    157164    <div id="templateside">
    158 
    159165<?php
    160166if ($allowed_files) :
    161167?>
    162168    <h3><?php _e('Templates'); ?></h3>
     169    <?php if ( $is_child_theme ) : ?>
     170    <p class="howto"><?php printf( __( 'This child theme inherits templates from a parent theme, %s.' ), $themes[$theme]['Parent Theme'] ); ?></p>
     171    <?php endif; ?>
    163172    <ul>
    164173<?php
     
    166175    $template_dir = $themes[$theme]['Template Dir'];
    167176    foreach ( $themes[$theme]['Template Files'] as $template_file ) {
     177        // Don't show parent templates.
     178        if ( $is_child_theme && strpos( $template_file, $themes[$theme]['Template Dir'] ) === 0 )
     179            continue;
     180
    168181        $description = trim( get_file_description($template_file) );
    169182        $template_show = basename($template_file);
     
    193206    $stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
    194207    foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
     208        // Don't show parent styles.
     209        if ( $is_child_theme && strpos( $style_file, $themes[$theme]['Template Dir'] ) === 0 )
     210            continue;
     211
    195212        $description = trim( get_file_description($style_file) );
    196213        $style_show = basename($style_file);
     
    225242
    226243        <div>
    227         <?php if ( is_child_theme() ) :
    228             if ( strpos( $file, $themes[$theme]['Template Dir'] ) === 0 ) { ?>
    229                 <p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
    230                 <?php printf( __( 'This is a file in your parent theme, &#8220;%s.&#8221;' ), $themes[$theme]['Parent Theme'] ); ?></p>
    231             <?php } else { ?>
    232                 <p><?php printf( __( 'This is a file in your child theme, &#8220;%s.&#8221;' ), $themes[$theme]['Name'] ); ?></p>
    233             <?php } ?>
     244        <?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_option('template') ) : ?>
     245            <p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
     246            <?php _e( 'This is a file in your current parent theme.' ); ?></p>
    234247        <?php endif; ?>
    235248<?php
  • trunk/wp-includes/script-loader.php

    r16686 r16714  
    507507    $styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20101020' );
    508508    $styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20101020' ); // Readme as well
    509     $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20100514' );
     509    $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20101203' );
    510510    $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20101020' );
    511511    $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
Note: See TracChangeset for help on using the changeset viewer.