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.

git-svn-id: https://develop.svn.wordpress.org/trunk@47844 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-05-22 23:18:47 +00:00
parent 3ab28fd579
commit a6cb663c13
1 changed files with 1 additions and 3 deletions

View File

@ -75,7 +75,6 @@ if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_c
$allowed_files = array();
$style_files = array();
$has_templates = false;
$file_types = wp_get_theme_file_editable_extensions( $theme );
@ -83,7 +82,6 @@ foreach ( $file_types as $type ) {
switch ( $type ) {
case 'php':
$allowed_files += $theme->get_files( 'php', -1 );
$has_templates = ! empty( $allowed_files );
break;
case 'css':
$style_files = $theme->get_files( 'css', -1 );
@ -252,7 +250,7 @@ if ( $theme->errors() ) {
<div id="templateside">
<h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
<ul role="tree" aria-labelledby="theme-files-label">
<?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
<?php if ( $theme->parent() ) : ?>
<li class="howto">
<?php
printf(