mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user