Don't even show parent theme files when viewing the child theme. see #15672.
git-svn-id: https://develop.svn.wordpress.org/trunk@16714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a01db8b692
commit
c8fc17767f
@ -1 +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%;}
|
h3 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%;}
|
@ -1,3 +1,7 @@
|
|||||||
|
h3 span {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
#template textarea {
|
#template textarea {
|
||||||
font-family: Consolas, Monaco, Courier, monospace;
|
font-family: Consolas, Monaco, Courier, monospace;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -125,7 +125,9 @@ default:
|
|||||||
<?php endif;
|
<?php endif;
|
||||||
|
|
||||||
$description = get_file_description($file);
|
$description = get_file_description($file);
|
||||||
$desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (%s)" : "%s";
|
$desc_header = ( $description != $file_show ) ? "$description <span>(%s)</span>" : "<span>%s</span>";
|
||||||
|
|
||||||
|
$is_child_theme = $themes[$theme]['Template'] != $themes[$theme]['Stylesheet'];
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<?php screen_icon(); ?>
|
<?php screen_icon(); ?>
|
||||||
@ -133,7 +135,12 @@ $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (
|
|||||||
|
|
||||||
<div class="fileedit-sub">
|
<div class="fileedit-sub">
|
||||||
<div class="alignleft">
|
<div class="alignleft">
|
||||||
<big><?php echo sprintf($desc_header, $file_show); ?></big>
|
<h3><?php
|
||||||
|
if ( $is_child_theme && strpos( $file, $themes[$theme]['Template Dir'] ) === 0 )
|
||||||
|
echo $themes[$theme]['Parent Theme'] . ': ';
|
||||||
|
else
|
||||||
|
echo $themes[$theme]['Name'] . ': ';
|
||||||
|
printf( $desc_header, $file_show ); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="alignright">
|
<div class="alignright">
|
||||||
<form action="theme-editor.php" method="post">
|
<form action="theme-editor.php" method="post">
|
||||||
@ -155,16 +162,22 @@ $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (
|
|||||||
<br class="clear" />
|
<br class="clear" />
|
||||||
</div>
|
</div>
|
||||||
<div id="templateside">
|
<div id="templateside">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($allowed_files) :
|
if ($allowed_files) :
|
||||||
?>
|
?>
|
||||||
<h3><?php _e('Templates'); ?></h3>
|
<h3><?php _e('Templates'); ?></h3>
|
||||||
|
<?php if ( $is_child_theme ) : ?>
|
||||||
|
<p class="howto"><?php printf( __( 'This child theme inherits templates from a parent theme, %s.' ), $themes[$theme]['Parent Theme'] ); ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
$template_mapping = array();
|
$template_mapping = array();
|
||||||
$template_dir = $themes[$theme]['Template Dir'];
|
$template_dir = $themes[$theme]['Template Dir'];
|
||||||
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
|
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
|
||||||
|
// Don't show parent templates.
|
||||||
|
if ( $is_child_theme && strpos( $template_file, $themes[$theme]['Template Dir'] ) === 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
$description = trim( get_file_description($template_file) );
|
$description = trim( get_file_description($template_file) );
|
||||||
$template_show = basename($template_file);
|
$template_show = basename($template_file);
|
||||||
$filedesc = ( $description != $template_file ) ? "$description<br /><span class='nonessential'>($template_show)</span>" : "$description";
|
$filedesc = ( $description != $template_file ) ? "$description<br /><span class='nonessential'>($template_show)</span>" : "$description";
|
||||||
@ -192,6 +205,10 @@ if ($allowed_files) :
|
|||||||
$template_mapping = array();
|
$template_mapping = array();
|
||||||
$stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
|
$stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
|
||||||
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
|
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
|
||||||
|
// Don't show parent styles.
|
||||||
|
if ( $is_child_theme && strpos( $style_file, $themes[$theme]['Template Dir'] ) === 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
$description = trim( get_file_description($style_file) );
|
$description = trim( get_file_description($style_file) );
|
||||||
$style_show = basename($style_file);
|
$style_show = basename($style_file);
|
||||||
$filedesc = ( $description != $style_file ) ? "$description<br /><span class='nonessential'>($style_show)</span>" : "$description";
|
$filedesc = ( $description != $style_file ) ? "$description<br /><span class='nonessential'>($style_show)</span>" : "$description";
|
||||||
@ -224,13 +241,9 @@ if ($allowed_files) :
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<?php if ( is_child_theme() ) :
|
<?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_option('template') ) : ?>
|
||||||
if ( strpos( $file, $themes[$theme]['Template Dir'] ) === 0 ) { ?>
|
<p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
|
||||||
<p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
|
<?php _e( 'This is a file in your current parent theme.' ); ?></p>
|
||||||
<?php printf( __( 'This is a file in your parent theme, “%s.”' ), $themes[$theme]['Parent Theme'] ); ?></p>
|
|
||||||
<?php } else { ?>
|
|
||||||
<p><?php printf( __( 'This is a file in your child theme, “%s.”' ), $themes[$theme]['Name'] ); ?></p>
|
|
||||||
<?php } ?>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php
|
<?php
|
||||||
if ( is_writeable( $file ) ) :
|
if ( is_writeable( $file ) ) :
|
||||||
|
@ -506,7 +506,7 @@ function wp_default_styles( &$styles ) {
|
|||||||
$styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20100610' );
|
$styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20100610' );
|
||||||
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20101020' );
|
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20101020' );
|
||||||
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20101020' ); // Readme as well
|
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20101020' ); // Readme as well
|
||||||
$styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20100514' );
|
$styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20101203' );
|
||||||
$styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20101020' );
|
$styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20101020' );
|
||||||
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
|
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
|
||||||
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20101020' );
|
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20101020' );
|
||||||
|
Loading…
Reference in New Issue
Block a user