WordPress.org

Make WordPress Core

Changeset 20116


Ignore:
Timestamp:
03/05/2012 05:30:09 PM (10 years ago)
Author:
nacin
Message:

Cast $wp_theme_directories to array. This had been done in get_themes(). A must-loaded plugin could call these functions before the first theme root is ever added. see #20103.

File:
1 edited

Legend:

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

    r20059 r20116  
    8989    if ( empty( $theme_root ) ) {
    9090        $theme_root = get_raw_theme_root( $stylesheet );
    91         if ( ! in_array( $theme_root, $wp_theme_directories ) )
     91        if ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
    9292            $theme_root = WP_CONTENT_DIR . $theme_root;
    9393    }
     
    493493        // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory.
    494494        // This gives relative theme roots the benefit of the doubt when things go haywire.
    495         if ( ! in_array( $theme_root, $wp_theme_directories ) )
     495        if ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
    496496            $theme_root = WP_CONTENT_DIR . $theme_root;
    497497    } else {
     
    516516
    517517    if ( $stylesheet_or_template && $theme_root = get_raw_theme_root( $stylesheet_or_template ) ) {
    518         if ( in_array( $theme_root, $wp_theme_directories ) ) {
     518        if ( in_array( $theme_root, (array) $wp_theme_directories ) ) {
    519519            // Absolute path. Make an educated guess. YMMV -- but note the filter below.
    520520            if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) )
Note: See TracChangeset for help on using the changeset viewer.