From 17b6ada24a05f84d0d0cc49fe8d89b6143a6ded5 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 3 Jan 2013 07:42:16 +0000 Subject: [PATCH] Upgrade: When upgrading from WordPress 3.5, if an empty twentytwelve theme directory exists, remove it to allow the installation of Twenty Twelve. See #22856. For trunk git-svn-id: https://develop.svn.wordpress.org/trunk@23253 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/update-core.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 610f7297f4..8211e454c0 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -705,6 +705,13 @@ function update_core($from, $to) { } } + // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve. + if ( '3.5' == $old_wp_version ) { + if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' ) ) { + $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' ); + } + } + // Copy New bundled plugins & themes // This gives us the ability to install new plugins & themes bundled with future versions of WordPress whilst avoiding the re-install upon upgrade issue. // $development_build controls us overwriting bundled themes and plugins when a non-stable release is being updated