Make WordPress Core

Changeset 23252


Ignore:
Timestamp:
01/03/2013 07:17:36 AM (13 years ago)
Author:
dd32
Message:

Upgrade: When upgrading from WordPress 3.5, if an empty twentytwelve theme directory exists, remove it and install Twenty Twelve. See #22856. For the 3.5 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-admin/includes/update-core.php

    r23251 r23252  
    693693    }
    694694
     695    // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.
     696    if ( '3.5' == $old_wp_version ) {
     697        if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' )  ) {
     698            // Bumping the introduced version to 3.5.1 for the affected users causes Twenty Twelve to be installed for the first time
     699            if ( $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' ) )
     700                $_new_bundled_files[ 'themes/twentytwelve/' ] = '3.5.1';
     701        }
     702    }
     703
    695704    // Copy New bundled plugins & themes
    696705    // This gives us the ability to install new plugins & themes bundled with future versions of WordPress whilst avoiding the re-install upon upgrade issue.
Note: See TracChangeset for help on using the changeset viewer.