<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14485] trunk: Remove WP_FALLBACK_THEME, use WP_DEFAULT_THEME instead.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14485">14485</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-06 19:53:40 +0000 (Thu, 06 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove WP_FALLBACK_THEME, use WP_DEFAULT_THEME instead. We now only fall back to the default theme if the theme is broken. Incomplete themes that need to inherit templates will inherit them from wp-includes/theme-compat -- this behavior is deprecated. fixes <a href="http://trac.wordpress.org/ticket/12846">#12846</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpincludesdefaultconstantsphp">trunk/wp-includes/default-constants.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (14484 => 14485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2010-05-06 19:36:20 UTC (rev 14484)
+++ trunk/wp-admin/includes/schema.php        2010-05-06 19:53:40 UTC (rev 14485)
</span><span class="lines">@@ -651,8 +651,8 @@
</span><span class="cx">         $allowed_themes = array( $stylesheet => true );
</span><span class="cx">         if ( $template != $stylesheet )
</span><span class="cx">                 $allowed_themes[ $template ] = true;
</span><del>-        if ( WP_FALLBACK_THEME != $stylesheet && WP_FALLBACK_THEME != $template )
-                $allowed_themes[ WP_FALLBACK_THEME ] = true;
</del><ins>+        if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template )
+                $allowed_themes[ WP_DEFAULT_THEME ] = true;
</ins><span class="cx">
</span><span class="cx">         if ( 1 == $network_id ) {
</span><span class="cx">                 $wpdb->insert( $wpdb->site, array( 'domain' => $domain, 'path' => $path ) );
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (14484 => 14485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-05-06 19:36:20 UTC (rev 14484)
+++ trunk/wp-admin/includes/upgrade.php        2010-05-06 19:53:40 UTC (rev 14485)
</span><span class="lines">@@ -1623,7 +1623,7 @@
</span><span class="cx">                 if ($oldfile == 'index.php') { // Check to make sure it's not a new index
</span><span class="cx">                         $index = implode('', file("$oldpath/$oldfile"));
</span><span class="cx">                         if (strpos($index, 'WP_USE_THEMES') !== false) {
</span><del>-                                if (! @copy(WP_CONTENT_DIR . '/themes/'.WP_FALLBACK_THEME.'/index.php', "$site_dir/$newfile"))
</del><ins>+                                if (! @copy(WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile"))
</ins><span class="cx">                                         return false;
</span><span class="cx">                                 continue; // Don't copy anything
</span><span class="cx">                                 }
</span><span class="lines">@@ -1683,7 +1683,7 @@
</span><span class="cx"> */
</span><span class="cx"> function make_site_theme_from_default($theme_name, $template) {
</span><span class="cx">         $site_dir = WP_CONTENT_DIR . "/themes/$template";
</span><del>-        $default_dir = WP_CONTENT_DIR . '/themes/'.WP_FALLBACK_THEME;
</del><ins>+        $default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME;
</ins><span class="cx">
</span><span class="cx">         // Copy files from the default theme to the site theme.
</span><span class="cx">         //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
</span><span class="lines">@@ -1779,7 +1779,7 @@
</span><span class="cx">
</span><span class="cx">         // Make the new site theme active.
</span><span class="cx">         $current_template = __get_option('template');
</span><del>-        if ($current_template == WP_FALLBACK_THEME) {
</del><ins>+        if ($current_template == WP_DEFAULT_THEME) {
</ins><span class="cx">                 update_option('template', $template);
</span><span class="cx">                 update_option('stylesheet', $template);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpincludesdefaultconstantsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-constants.php (14484 => 14485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-constants.php        2010-05-06 19:36:20 UTC (rev 14484)
+++ trunk/wp-includes/default-constants.php        2010-05-06 19:53:40 UTC (rev 14485)
</span><span class="lines">@@ -286,18 +286,12 @@
</span><span class="cx">         /**
</span><span class="cx">          * Slug of the default theme for this install.
</span><span class="cx">          * Used as the default theme when installing new sites.
</span><ins>+         * Will be used as the fallback if the current theme doesn't exist.
</ins><span class="cx">          * @since 3.0.0
</span><span class="cx">          */
</span><span class="cx">         if ( !defined('WP_DEFAULT_THEME') )
</span><span class="cx">                 define( 'WP_DEFAULT_THEME', 'twentyten' );
</span><span class="cx">
</span><del>-        /**
-         * Slug of the fallback theme for this install.
-         * Will be used as the fallback if the current theme doesn't exist.
-         * @since 3.0.0
-         */
-        if ( !defined('WP_FALLBACK_THEME') )
-                define( 'WP_FALLBACK_THEME', WP_DEFAULT_THEME );
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ?>
</span></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (14484 => 14485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2010-05-06 19:36:20 UTC (rev 14484)
+++ trunk/wp-includes/theme.php        2010-05-06 19:53:40 UTC (rev 14485)
</span><span class="lines">@@ -1207,13 +1207,13 @@
</span><span class="cx"> /**
</span><span class="cx"> * Checks that current theme files 'index.php' and 'style.css' exists.
</span><span class="cx"> *
</span><del>- * Does not check the fallback theme. The fallback theme should always exist.
</del><ins>+ * Does not check the default theme, which is the fallback and should always exist.
</ins><span class="cx"> * Will switch theme to the fallback theme if current theme does not validate.
</span><span class="cx"> * You can use the 'validate_current_theme' filter to return FALSE to
</span><span class="cx"> * disable this functionality.
</span><span class="cx"> *
</span><span class="cx"> * @since 1.5.0
</span><del>- * @see WP_FALLBACK_THEME
</del><ins>+ * @see WP_DEFAULT_THEME
</ins><span class="cx"> *
</span><span class="cx"> * @return bool
</span><span class="cx"> */
</span><span class="lines">@@ -1222,13 +1222,13 @@
</span><span class="cx">         if ( defined('WP_INSTALLING') || !apply_filters( 'validate_current_theme', true ) )
</span><span class="cx">                 return true;
</span><span class="cx">
</span><del>-        if ( get_template() != WP_FALLBACK_THEME && !file_exists(get_template_directory() . '/index.php') ) {
-                switch_theme( WP_FALLBACK_THEME, WP_FALLBACK_THEME );
</del><ins>+        if ( get_template() != WP_DEFAULT_THEME && !file_exists(get_template_directory() . '/index.php') ) {
+                switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if ( get_stylesheet() != WP_FALLBACK_THEME && !file_exists(get_template_directory() . '/style.css') ) {
-                switch_theme( WP_FALLBACK_THEME, WP_FALLBACK_THEME );
</del><ins>+        if ( get_stylesheet() != WP_DEFAULT_THEME && !file_exists(get_template_directory() . '/style.css') ) {
+                switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>