From c7fe20580528e04fbc4ada64b33ed51ddeb2075e Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 4 Dec 2010 03:52:59 +0000 Subject: [PATCH] Don't even show parent theme files when viewing the child theme. see #15672. git-svn-id: http://svn.automattic.com/wordpress/trunk@16714 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/theme-editor.css | 2 +- wp-admin/css/theme-editor.dev.css | 4 ++++ wp-admin/theme-editor.php | 33 +++++++++++++++++++++---------- wp-includes/script-loader.php | 2 +- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/wp-admin/css/theme-editor.css b/wp-admin/css/theme-editor.css index fdfdbbee7..aebb68b70 100644 --- a/wp-admin/css/theme-editor.css +++ b/wp-admin/css/theme-editor.css @@ -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%;} \ No newline at end of file +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%;} \ No newline at end of file diff --git a/wp-admin/css/theme-editor.dev.css b/wp-admin/css/theme-editor.dev.css index 17546493c..1b6cbf605 100644 --- a/wp-admin/css/theme-editor.dev.css +++ b/wp-admin/css/theme-editor.dev.css @@ -1,3 +1,7 @@ +h3 span { + font-weight: normal; +} + #template textarea { font-family: Consolas, Monaco, Courier, monospace; font-size: 12px; diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index ae1f5e6a0..3779de43e 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -125,7 +125,9 @@ default: $description (%s)" : "%s"; +$desc_header = ( $description != $file_show ) ? "$description (%s)" : "%s"; + +$is_child_theme = $themes[$theme]['Template'] != $themes[$theme]['Stylesheet']; ?>
@@ -133,7 +135,12 @@ $desc_header = ( $description != $file_show ) ? "$description (
- +

@@ -155,16 +162,22 @@ $desc_header = ( $description != $file_show ) ? "$description (
-

+ +

+
    ($template_show)" : "$description"; @@ -192,6 +205,10 @@ if ($allowed_files) : $template_mapping = array(); $stylesheet_dir = $themes[$theme]['Stylesheet Dir']; 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) ); $style_show = basename($style_file); $filedesc = ( $description != $style_file ) ? "$description
    ($style_show)" : "$description"; @@ -224,13 +241,9 @@ if ($allowed_files) :
    - -

    -

    - -

    - + +

    +

    add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20100610' ); $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( '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( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' ); $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20101020' );