If a cached theme root is no longer registered, skip it. Assume the cache is out of date. see #20103.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-04-20 13:22:54 +00:00
parent 6d13f920fd
commit fe63ec5dec
1 changed files with 3 additions and 0 deletions

View File

@ -340,6 +340,9 @@ function search_theme_directories( $force = false ) {
$cached_roots = get_site_transient( 'theme_roots' );
if ( is_array( $cached_roots ) ) {
foreach ( $cached_roots as $theme_dir => $theme_root ) {
// A cached theme root is no longer around, so skip it.
if ( ! isset( $relative_theme_roots[ $theme_root ] ) )
continue;
$found_themes[ $theme_dir ] = array(
'theme_file' => $theme_dir . '/style.css',
'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute.