Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47299 closed enhancement (fixed)

Site Health: get_test_theme_version() + WP_DEFAULT_THEME = use get_core_default_theme() !

Reported by: juliobox's profile juliobox Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: minor Version: 5.2
Component: Site Health Keywords: 2nd-opinion site-health has-patch
Focuses: Cc:


Hello there

The test for get_test_theme_version() is checking if WP_DEFAULT_THEME is set to one of our installed theme. If not, the SH will tell us to use one.
But since I have a twentystuff theme on my installation, WordPress will find a fallback. Thanks to get_core_default_theme()!

We should also use this as a check.
I just did this:

if ( ! $has_default_theme ) {


if ( ! $has_default_theme && ! WP_Theme::get_core_default_theme() ) {

That does the correct test I guess.

Thank you!

Attachments (1)

class-wp-site-health.php.patch (571 bytes) - added by ajayghaghretiya1 5 years ago.
updated the file with the patch, Also check class exist.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
5 years ago

  • Keywords site-health added

#2 @SergeyBiryukov
5 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Awaiting Review to 5.3

Makes sense to me, populate_options() and validate_current_theme() do the same.

5 years ago

updated the file with the patch, Also check class exist.

#3 @audrasjb
5 years ago

  • Keywords has-patch added; needs-patch removed

#4 @desrosj
5 years ago

  • Component changed from Administration to Site Health

Moving Site Health tickets into their lovely new home, the Site Health component.

#5 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#6 @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45732:

Site Health: If WP_DEFAULT_THEME doesn't exist, use WP_Theme::get_core_default_theme() as a fallback.

Props ajayghaghretiya1, juliobox, SergeyBiryukov.
Fixes #47299.

Note: See TracTickets for help on using tickets.