[wp-trac] [WordPress Trac] #20919: Live Preview post-installation fails with multiple theme directories

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 12 12:02:34 UTC 2012


#20919: Live Preview post-installation fails with multiple theme directories
--------------------------+-----------------------------
 Reporter:  duck_         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  3.4
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If another theme directory is registered with register_theme_directory()
 then clicking Live Preview on the post-installation screen results in a
 "Cheatin' uh?" message.

 Tested with a checkout of wpcom-themes in the wp-content directory with a
 one line plugin:

 {{{
 register_theme_directory( '/srv/http/wp.dev/public/wp-content/wpcom-
 themes' );
 }}}

 The problem is that get_theme_roots() returns the array stored in the
 theme_roots transient. This doesn't contain a value for the newly
 installed theme yet, so get_raw_theme_root() returns false. Therefore,
 wp_get_theme( 'newly-installed-theme' ) uses WP_CONTENT_DIR as the value
 for $theme_root. So, the returned WP_Theme has a theme_not_found error.

 So, the theme exists check in WP_Customize_Manager::setup_theme() fails
 and a "Cheatin' uh?" message is displayed.

 A possible solution is the trash the theme_roots site transient post
 install so that the next get_theme_roots() calls
 search_theme_directories().

 This is spun out of ocean90's comment on #20914.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20919>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list