mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-24 08:21:38 +01:00
Switch to a constant for the fallback theme. See #9015.
git-svn-id: http://svn.automattic.com/wordpress/trunk@13019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8e1a363a8d
commit
333f5b0cfa
wp-includes
@ -258,6 +258,13 @@ function wp_default_constants( $context ) {
|
|||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
*/
|
*/
|
||||||
define('STYLESHEETPATH', get_stylesheet_directory());
|
define('STYLESHEETPATH', get_stylesheet_directory());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
define( 'WP_FALLBACK_THEME', 'twentyten' );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -951,7 +951,7 @@ function get_attachment_template() {
|
|||||||
function get_comments_popup_template() {
|
function get_comments_popup_template() {
|
||||||
$template = locate_template(array("comments-popup.php"));
|
$template = locate_template(array("comments-popup.php"));
|
||||||
if ('' == $template)
|
if ('' == $template)
|
||||||
$template = get_theme_root() . '/default/comments-popup.php';
|
$template = get_theme_root() . '/' . WP_FALLBACK_THEME . '/comments-popup.php';
|
||||||
|
|
||||||
return apply_filters('comments_popup_template', $template);
|
return apply_filters('comments_popup_template', $template);
|
||||||
}
|
}
|
||||||
@ -1160,15 +1160,13 @@ function validate_current_theme() {
|
|||||||
if ( defined('WP_INSTALLING') || !apply_filters( 'validate_current_theme', true ) )
|
if ( defined('WP_INSTALLING') || !apply_filters( 'validate_current_theme', true ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
$fallback = 'twentyten';
|
if ( get_template() != WP_FALLBACK_THEME && !file_exists(get_template_directory() . '/index.php') ) {
|
||||||
|
switch_theme( WP_FALLBACK_THEME, WP_FALLBACK_THEME );
|
||||||
if ( get_template() != $fallback && !file_exists(get_template_directory() . '/index.php') ) {
|
|
||||||
switch_theme($fallback, $fallback);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( get_stylesheet() != $fallback && !file_exists(get_template_directory() . '/style.css') ) {
|
if ( get_stylesheet() != WP_FALLBACK_THEME && !file_exists(get_template_directory() . '/style.css') ) {
|
||||||
switch_theme($fallback, $fallback);
|
switch_theme( WP_FALLBACK_THEME, WP_FALLBACK_THEME );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user