WordPress.org

Make WordPress Core

Changeset 47844


Ignore:
Timestamp:
05/22/2020 11:18:47 PM (6 days ago)
Author:
SergeyBiryukov
Message:

Theme Editor: Remove unused $has_templates boolean.

The variable is a remnant from when the Theme Editor still had the "Templates" heading and is unused in the current logic.

The condition it was a part of would always evaluate to true for a child theme, regardless of the $has_templates value.

Props dboy1988.
Fixes #50199.

File:
1 edited

Legend:

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

    r47808 r47844  
    7676$allowed_files = array();
    7777$style_files   = array();
    78 $has_templates = false;
    7978
    8079$file_types = wp_get_theme_file_editable_extensions( $theme );
     
    8483        case 'php':
    8584            $allowed_files += $theme->get_files( 'php', -1 );
    86             $has_templates  = ! empty( $allowed_files );
    8785            break;
    8886        case 'css':
     
    253251    <h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
    254252    <ul role="tree" aria-labelledby="theme-files-label">
    255         <?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
     253        <?php if ( $theme->parent() ) : ?>
    256254            <li class="howto">
    257255                <?php
Note: See TracChangeset for help on using the changeset viewer.