From c0bec847d1374979ca2a2080e57d45f3c9bc004e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 22 May 2020 23:20:08 +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. Built from https://develop.svn.wordpress.org/trunk@47844 git-svn-id: http://core.svn.wordpress.org/trunk@47620 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/theme-editor.php | 4 +--- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 411003c929..432e36f7db 100644 --- a/wp-admin/theme-editor.php +++ b/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() ) {