Add switch_theme(). Cache current theme in options to avoid calling get_themes(). fixes #5346

git-svn-id: https://develop.svn.wordpress.org/trunk@6334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-11-13 05:07:44 +00:00
parent f00acd7eb0
commit 31fc42f07b
2 changed files with 16 additions and 14 deletions

View File

@@ -5,14 +5,7 @@ if ( isset($_GET['action']) ) {
check_admin_referer('switch-theme_' . $_GET['template']);
if ('activate' == $_GET['action']) {
if ( isset($_GET['template']) )
update_option('template', $_GET['template']);
if ( isset($_GET['stylesheet']) )
update_option('stylesheet', $_GET['stylesheet']);
do_action('switch_theme', get_current_theme());
switch_theme($_GET['template'], $_GET['stylesheet']);
wp_redirect('themes.php?activated=true');
exit;
}