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:
parent
e7150ae5c7
commit
c0bec847d1
|
@ -75,7 +75,6 @@ if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_c
|
||||||
|
|
||||||
$allowed_files = array();
|
$allowed_files = array();
|
||||||
$style_files = array();
|
$style_files = array();
|
||||||
$has_templates = false;
|
|
||||||
|
|
||||||
$file_types = wp_get_theme_file_editable_extensions( $theme );
|
$file_types = wp_get_theme_file_editable_extensions( $theme );
|
||||||
|
|
||||||
|
@ -83,7 +82,6 @@ foreach ( $file_types as $type ) {
|
||||||
switch ( $type ) {
|
switch ( $type ) {
|
||||||
case 'php':
|
case 'php':
|
||||||
$allowed_files += $theme->get_files( 'php', -1 );
|
$allowed_files += $theme->get_files( 'php', -1 );
|
||||||
$has_templates = ! empty( $allowed_files );
|
|
||||||
break;
|
break;
|
||||||
case 'css':
|
case 'css':
|
||||||
$style_files = $theme->get_files( 'css', -1 );
|
$style_files = $theme->get_files( 'css', -1 );
|
||||||
|
@ -252,7 +250,7 @@ if ( $theme->errors() ) {
|
||||||
<div id="templateside">
|
<div id="templateside">
|
||||||
<h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
|
<h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
|
||||||
<ul role="tree" aria-labelledby="theme-files-label">
|
<ul role="tree" aria-labelledby="theme-files-label">
|
||||||
<?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
|
<?php if ( $theme->parent() ) : ?>
|
||||||
<li class="howto">
|
<li class="howto">
|
||||||
<?php
|
<?php
|
||||||
printf(
|
printf(
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue