[wp-trac] [WordPress Trac] #34306: Twenty Sixteen as default theme

WordPress Trac noreply at wordpress.org
Wed Nov 25 08:26:12 UTC 2015


#34306: Twenty Sixteen as default theme
----------------------------+-----------------------
 Reporter:  SergeyBiryukov  |       Owner:
     Type:  task (blessed)  |      Status:  assigned
 Priority:  normal          |   Milestone:  4.4
Component:  Bundled Theme   |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+-----------------------

Comment (by dd32):

 Testing results with [attachment:34306.4.diff]
  * Defining `WP_DEFAULT_THEME` to something that doesn't exist:  WordPress
 selected the first core theme that exists. '''Pass'''
  * Defining `WP_DEFAULT_THEME` to something that exists: WordPress does
 what it does best, just work. '''Pass'''
  * Defining `WP_DEFAULT_THEME` as `twentysixteen`, activating that theme,
 and removing it causing WSOD: `validate_current_theme()` says it's a valid
 theme, assumes that `WP_DEFAULT_THEME` always exists. '''FAIL, Fixed'''
  * Defining `WP_DEFAULT_THEME` as `invalid-theme`, removing the current
 active theme: `validate_current_theme()` says the theme is invalid,
 Switches to the first default theme as `invalid-theme` wasn't installed.
 '''Pass'''
  * Creating a Network with `WP_DEFAULT_THEME` as `invalid-theme`: Fails to
 whitelist first default theme. Uses `WP_Theme` object instead of
 `WP_Theme->get_stylesheet()`: '''FAIL, Fixed'''
  * Creating a new site with `WP_DEFAULT_THEME` as `invalid-theme` with
 first default theme whitelisted: Site created with the first default
 theme. '''Pass'''
  * Creating a new site with `WP_DEFAULT_THEME` as `invalid-theme` with
 first default theme not whitelisted: Site created with the first default
 theme, not marked "enabled" for site, Unable to test further. '''Assumed
 OK'''.
  * Upgrading a site: Default Themes not installed (Not even older default
 themes) '''Pass'''
  * Upgrading a site with `define( 'CORE_UPGRADE_SKIP_NEW_BUNDLED', false
 )` - All default themes installed '''Pass'''

 The failures above were fixed as i went along, [attachment:34306.5.diff]
 being the result.

 Fixes:
  1. `validate_current_theme()` - Removed the checking for
 `WP_DEFAULT_THEME` from the Invalid/Valid if branches. This was no longer
 needed now that the function would conditionally set the default theme.
  2. `schema.php` - Used `WP_Theme->get_stylesheet()` instead of the
 object.

 Anyone see a test case which I didn't test above?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34306#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list