Make WordPress Core


Ignore:
Timestamp:
03/15/2012 03:39:21 PM (10 years ago)
Author:
nacin
Message:

Updates to WP_Theme, wp_get_themes(), and related deprecated functions, after [UT570] [UT578] [UT579]. see #20103.

  • Template Files? and Stylesheet Files? need to return files from the parent theme as well.
  • Don't strip links from the Author header. Some themes rely on the previous behavior, such as to link multiple authors (Sandbox, for example.) Don't restore links to the Name, that's just a bad idea.
  • Ensure we are always passing around arrays in get_files/scandir.
  • Better inline doc for wp_get_themes() arguments.
  • Introduce a 'force' flag for search_theme_directories() to re-scan, rather than return the cache. We will use this to re-build the theme_roots transient in get_theme_roots(), but it is more helpful for unit tests. Since search_theme_directories() is cached, don't cache again in wp_get_themes(). (Again benefits testing.)
  • Handle duplicate theme names in the old get_themes() when two themes match (and neither are a default theme, which is already handled). wp_get_themes() will consider both names to be the same; this is just for back compat since get_themes() is keyed by name.
  • Include an old array key in wp_broken_themes().
File:
1 edited

Legend:

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

    r20042 r20193  
    29342934
    29352935    foreach ( $themes as $theme ) {
    2936         $wp_themes[ $theme->get('Name') ] = $theme;
     2936        $name = $theme->get('Name');
     2937        if ( isset( $wp_themes[ $name ] ) )
     2938            $wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
     2939        else
     2940            $wp_themes[ $name ] = $theme;
    29372941    }
    29382942
Note: See TracChangeset for help on using the changeset viewer.