Changeset 6334
- Timestamp:
- 11/13/2007 05:07:44 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/themes.php
r6033 r6334 6 6 7 7 if ('activate' == $_GET['action']) { 8 if ( isset($_GET['template']) ) 9 update_option('template', $_GET['template']); 10 11 if ( isset($_GET['stylesheet']) ) 12 update_option('stylesheet', $_GET['stylesheet']); 13 14 do_action('switch_theme', get_current_theme()); 15 8 switch_theme($_GET['template'], $_GET['stylesheet']); 16 9 wp_redirect('themes.php?activated=true'); 17 10 exit; -
trunk/wp-includes/theme.php
r6099 r6334 295 295 296 296 function get_current_theme() { 297 if ( $theme = get_option('current_theme') ) 298 return $theme; 299 297 300 $themes = get_themes(); 298 301 $theme_names = array_keys($themes); … … 310 313 } 311 314 } 315 316 update_option('current_theme', $current_theme); 312 317 313 318 return $current_theme; … … 448 453 } 449 454 455 function switch_theme($template, $stylesheet) { 456 update_option('template', $template); 457 update_option('stylesheet', $stylesheet); 458 delete_option('current_theme'); 459 $theme = get_current_theme(); 460 do_action('switch_theme', $theme); 461 } 462 450 463 function validate_current_theme() { 451 464 // Don't validate during an install/upgrade. … … 454 467 455 468 if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) { 456 update_option('template', 'default'); 457 update_option('stylesheet', 'default'); 458 do_action('switch_theme', 'Default'); 469 switch_theme('default', 'default'); 459 470 return false; 460 471 } 461 472 462 473 if ( get_stylesheet() != 'default' && !file_exists(get_template_directory() . '/style.css') ) { 463 update_option('template', 'default'); 464 update_option('stylesheet', 'default'); 465 do_action('switch_theme', 'Default'); 474 switch_theme('default', 'default'); 466 475 return false; 467 476 }
Note: See TracChangeset
for help on using the changeset viewer.