Changeset 4017
- Timestamp:
- 07/11/2006 10:44:56 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r3999 r4017 1255 1255 } 1256 1256 1257 function validate_current_theme() {1258 $theme_loc = 'wp-content/themes';1259 $theme_root = ABSPATH.$theme_loc;1260 1261 $template = get_settings('template');1262 $stylesheet = get_settings('stylesheet');1263 1264 if (($template != 'default') && (!file_exists("$theme_root/$template/index.php"))) {1265 update_option('template', 'default');1266 update_option('stylesheet', 'default');1267 do_action('switch_theme', 'Default');1268 return false;1269 }1270 1271 if (($stylesheet != 'default') && (!file_exists("$theme_root/$stylesheet/style.css"))) {1272 update_option('template', 'default');1273 update_option('stylesheet', 'default');1274 do_action('switch_theme', 'Default');1275 return false;1276 }1277 1278 return true;1279 }1280 1281 1257 function get_broken_themes() { 1282 1258 global $wp_broken_themes; -
trunk/wp-includes/theme.php
r3730 r4017 27 27 28 28 function get_template() { 29 $template = get_settings('template');30 if (!file_exists(get_theme_root() . "/$template")) { //works for dirs too31 update_option('template', 'default');32 update_option('stylesheet', 'default');33 }34 29 return apply_filters('template', get_settings('template')); 35 30 } … … 375 370 } 376 371 372 function validate_current_theme() { 373 if ((get_template() != 'default') && (!file_exists(get_template_directory() . '/index.php'))) { 374 update_option('template', 'default'); 375 update_option('stylesheet', 'default'); 376 do_action('switch_theme', 'Default'); 377 return false; 378 } 379 380 if ((get_stylesheet() != 'default') && (!file_exists(get_template_directory() . '/style.css'))) { 381 update_option('template', 'default'); 382 update_option('stylesheet', 'default'); 383 do_action('switch_theme', 'Default'); 384 return false; 385 } 386 387 return true; 388 } 389 377 390 ?> -
trunk/wp-settings.php
r3985 r4017 201 201 $wp = new WP(); 202 202 203 validate_current_theme(); 203 204 define('TEMPLATEPATH', get_template_directory()); 204 205
Note: See TracChangeset
for help on using the changeset viewer.