Make WordPress Core


Ignore:
Timestamp:
11/25/2015 09:44:02 PM (9 years ago)
Author:
wonderboymusic
Message:

Upgrade: New themes are not automatically installed on upgrade. This can still be explicitly asked for by defining CORE_UPGRADE_SKIP_NEW_BUNDLED as false.

In populate_options(), if the theme specified by WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme. If we can't find a core default theme, WP_DEFAULT_THEME is the best we can do.

Props nacin, jeremyfelt, dd32.
See #34306.

File:
1 edited

Legend:

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

    r34995 r35738  
    5757        'twentyfourteen' => 'Twenty Fourteen',
    5858        'twentyfifteen'  => 'Twenty Fifteen',
     59        'twentysixteen'  => 'Twenty Sixteen',
    5960    );
    6061
     
    11521153
    11531154    /**
     1155     * Determines the latest WordPress default theme that is installed.
     1156     *
     1157     * This hits the filesystem.
     1158     *
     1159     * @return WP_Theme|false Object, or false if no theme is installed, which would be bad.
     1160     */
     1161    public static function get_core_default_theme() {
     1162        foreach ( array_reverse( self::$default_themes ) as $slug => $name ) {
     1163            $theme = wp_get_theme( $slug );
     1164            if ( $theme->exists() ) {
     1165                return $theme;
     1166            }
     1167        }
     1168        return false;
     1169    }
     1170
     1171    /**
    11541172     * Returns array of stylesheet names of themes allowed on the site or network.
    11551173     *
Note: See TracChangeset for help on using the changeset viewer.