Make WordPress Core

Changeset 20375


Ignore:
Timestamp:
04/05/2012 08:38:42 PM (13 years ago)
Author:
nacin
Message:

Internally cache themes inside wp_get_themes() by theme_root as well as stylesheet, to avoid conflicts with future calls to wp_get_themes(). Always return only the last stylesheet found, as before. see #20103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r20363 r20375  
    6464
    6565    foreach ( $theme_directories as $theme => $theme_root ) {
    66         if ( isset( $_themes[ $theme ] ) )
    67             $themes[ $theme ] = $_themes[ $theme ];
     66        if ( isset( $_themes[ $theme_root['theme_root'] . '/' . $theme ] ) )
     67            $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ];
    6868        else
    69             $themes[ $theme ] = $_themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );
     69            $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] );
    7070    }
    7171
     
    325325
    326326    $found_themes = array();
     327
     328    $wp_theme_directories = (array) $wp_theme_directories;
    327329
    328330    // Set up maybe-relative, maybe-absolute array of theme directories.
Note: See TracChangeset for help on using the changeset viewer.