Changeset 45732
- Timestamp:
- 08/04/2019 12:01:14 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-health.php
r45691 r45732 446 446 $active_theme = wp_get_theme(); 447 447 448 // If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme. 449 $default_theme = wp_get_theme( WP_DEFAULT_THEME ); 450 if ( ! $default_theme->exists() ) { 451 $default_theme = WP_Theme::get_core_default_theme(); 452 } 453 454 if ( $default_theme ) { 455 $has_default_theme = true; 456 457 if ( 458 $active_theme->get_stylesheet() === $default_theme->get_stylesheet() 459 || 460 is_child_theme() && $active_theme->get_template() === $default_theme->get_template() 461 ) { 462 $using_default_theme = true; 463 } 464 } 465 448 466 foreach ( $all_themes as $theme_slug => $theme ) { 449 467 $themes_total++; 450 468 451 if ( WP_DEFAULT_THEME === $theme_slug ) {452 $has_default_theme = true;453 454 if ( get_stylesheet() === $theme_slug ) {455 $using_default_theme = true;456 }457 }458 459 469 if ( array_key_exists( $theme_slug, $theme_updates ) ) { 460 470 $themes_need_updates++; … … 463 473 464 474 // If this is a child theme, increase the allowed theme count by one, to account for the parent. 465 if ( $active_theme->parent() ) {475 if ( is_child_theme() ) { 466 476 $allowed_theme_count++; 467 468 if ( $active_theme->get_template() === WP_DEFAULT_THEME ) {469 $using_default_theme = true;470 }471 477 } 472 478 … … 525 531 526 532 // This is a child theme, so we want to be a bit more explicit in our messages. 527 if ( $active_theme->parent() ) {533 if ( is_child_theme() ) { 528 534 // Recommend removing inactive themes, except a default theme, your current one, and the parent theme. 529 535 $result['status'] = 'recommended'; … … 565 571 /* translators: 1: The default theme for WordPress. 2: The currently active theme. 3: The active theme's parent theme. */ 566 572 __( 'To enhance your site’s security, we recommend you remove any themes you’re not using. You should keep %1$s, the default WordPress theme, %2$s, your current theme, and %3$s, its parent theme.' ), 567 WP_DEFAULT_THEME,573 $default_theme ? $default_theme->name : WP_DEFAULT_THEME, 568 574 $active_theme->name, 569 575 $active_theme->parent()->name … … 603 609 ), 604 610 $themes_inactive, 605 WP_DEFAULT_THEME,611 $default_theme ? $default_theme->name : WP_DEFAULT_THEME, 606 612 $active_theme->name 607 613 ),
Note: See TracChangeset
for help on using the changeset viewer.