WordPress.org

Make WordPress Core

Ticket #16607: fix-child-theme-editor.diff

File fix-child-theme-editor.diff, 1.1 KB (added by chrisbliss18, 7 years ago)
  • wp-admin/theme-editor.php

    diff --git wp-admin/theme-editor.php wp-admin/theme-editor.php
    index 12681a7..1fc5c48 100644
    if ($allowed_files) : 
    180180        $template_dir = $themes[$theme]['Template Dir'];
    181181        foreach ( $themes[$theme]['Template Files'] as $template_file ) {
    182182                // Don't show parent templates.
    183                 if ( $is_child_theme && strpos( $template_file, $themes[$theme]['Template Dir'] ) === 0 )
     183                if ( $is_child_theme && strpos( $template_file, trailingslashit( $themes[$theme]['Template Dir'] ) ) === 0 )
    184184                        continue;
    185185
    186186                $description = trim( get_file_description($template_file) );
    if ($allowed_files) : 
    202202        $stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
    203203        foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
    204204                // Don't show parent styles.
    205                 if ( $is_child_theme && strpos( $style_file, $themes[$theme]['Template Dir'] ) === 0 )
     205                if ( $is_child_theme && strpos( $style_file, trailingslashit( $themes[$theme]['Template Dir'] ) ) === 0 )
    206206                        continue;
    207207
    208208                $description = trim( get_file_description($style_file) );