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;
}
<?php if ( ! validate_current_theme() ) : ?>
<div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
<?php elseif ( isset($_GET['activated']) ) : ?>
-<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('url') . '/'); ?></p></div>
+<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">Visit site</a>'), get_bloginfo('url') . '/'); ?></p></div>
<?php endif; ?>
<?php
<?php } else { ?>
<p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?></p>
<?php } ?>
+<?php if ( $ct->tags ) : ?>
+<p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
+<?php endif; ?>
</div>
<h2><?php _e('Available Themes'); ?></h2>
$author = $themes[$theme_name]['Author'];
$screenshot = $themes[$theme_name]['Screenshot'];
$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
+ $tags = $themes[$theme_name]['Tags'];
$activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
?>
<div class="available-theme">
</a>
<p><?php echo $description; ?></p>
+<?php if ( $tags ) : ?>
+<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
+<?php endif; ?>
</div>
<?php } // end foreach theme_names ?>