Site Health: Use `WP_Theme::parent()` in the inactive themes test as a more reliable check that the parent theme exists.

This is also more consistent with the other instances of directly referencing `WP_Theme::parent()` properties or methods in core.

Props mukesh27, juanlopez4691, davidbaumwald, afragen, SergeyBiryukov.
Fixes #49934.

git-svn-id: https://develop.svn.wordpress.org/trunk@47815 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-05-18 04:36:57 +00:00
parent 5e43c07be4
commit 6ec559b2ba
1 changed files with 1 additions and 1 deletions

View File

@ -596,7 +596,7 @@ class WP_Site_Health {
if ( $has_unused_themes && $show_unused_themes && ! is_multisite() ) {
// This is a child theme, so we want to be a bit more explicit in our messages.
if ( is_child_theme() ) {
if ( $active_theme->parent() ) {
// Recommend removing inactive themes, except a default theme, your current one, and the parent theme.
$result['status'] = 'recommended';