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.
Built from https://develop.svn.wordpress.org/trunk@47844


git-svn-id: http://core.svn.wordpress.org/trunk@47620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-05-22 23:20:08 +00:00
parent e7150ae5c7
commit c0bec847d1
2 changed files with 2 additions and 4 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(

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47842';
$wp_version = '5.5-alpha-47844';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.