From a6cb663c138a2c4b638d391973384965e768da7f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 22 May 2020 23:18:47 +0000 Subject: [PATCH] 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 --- src/wp-admin/theme-editor.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-admin/theme-editor.php b/src/wp-admin/theme-editor.php index 411003c929..432e36f7db 100644 --- a/src/wp-admin/theme-editor.php +++ b/src/wp-admin/theme-editor.php @@ -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() ) {