Add switch_theme action. Cleanup staticize-reloaded's cache when theme is switched.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-10-06 06:20:52 +00:00
parent 6337530119
commit 0f9c6ec8e9
3 changed files with 5 additions and 0 deletions

View File

@ -743,12 +743,14 @@ function validate_current_theme() {
if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) {
update_option('template', 'default');
update_option('stylesheet', 'default');
do_action('switch_theme', 'Default');
return false;
}
if (($stylesheet != 'default') && (! file_exists("$theme_root/$stylesheet/style.css"))) {
update_option('template', 'default');
update_option('stylesheet', 'default');
do_action('switch_theme', 'Default');
return false;
}

View File

@ -15,6 +15,8 @@ if ( isset($_GET['action']) ) {
update_option('stylesheet', $_GET['stylesheet']);
}
do_action('switch_theme', get_current_theme());
header('Location: themes.php?activated=true');
}
}

View File

@ -153,6 +153,7 @@ if(function_exists('add_action')) {
add_action('edit_comment', 'postChange', 0);
add_action('delete_comment', 'postChange', 0);
add_action('template_save', 'postChange', 0);
add_action('switch_theme', 'postChange', 0);
}
if ( isset($_GET['staticize-flush']) ) {