Site Health: Fix count of inactive themes and the recommendation to remove them when the default theme is active or is a parent of the active child theme.
Props sudhiryadav, ianbelanger, mukesh27, azaozz. Fixes #46900. git-svn-id: https://develop.svn.wordpress.org/trunk@45260 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
14fc4634a2
commit
e13ef071ff
@ -464,10 +464,14 @@ class WP_Site_Health {
|
|||||||
// If this is a child theme, increase the allowed theme count by one, to account for the parent.
|
// If this is a child theme, increase the allowed theme count by one, to account for the parent.
|
||||||
if ( $active_theme->parent() ) {
|
if ( $active_theme->parent() ) {
|
||||||
$allowed_theme_count++;
|
$allowed_theme_count++;
|
||||||
|
|
||||||
|
if ( $active_theme->get_template() === WP_DEFAULT_THEME ) {
|
||||||
|
$using_default_theme = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there's a default theme installed, we count that as allowed as well.
|
// If there's a default theme installed and not in use, we count that as allowed as well.
|
||||||
if ( $has_default_theme ) {
|
if ( $has_default_theme && ! $using_default_theme ) {
|
||||||
$allowed_theme_count++;
|
$allowed_theme_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user