]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/themes.php
Wordpress 2.5.1
[autoinstalls/wordpress.git] / wp-admin / themes.php
index 8aa783aa8d2691fddd8b333094eb5c09a408a2b2..cb8d082baec1b9e7fde346664ee692a604b2a43e 100644 (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;
        }
@@ -26,7 +19,7 @@ require_once('admin-header.php');
 <?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 &raquo;</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
@@ -47,6 +40,9 @@ $ct = current_theme_info();
 <?php } else { ?>
        <p><?php printf(__('All of this theme&#8217;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>
@@ -69,6 +65,7 @@ foreach ($theme_names as $theme_name) {
        $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&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
 ?>
 <div class="available-theme">
@@ -81,6 +78,9 @@ foreach ($theme_names as $theme_name) {
 </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 ?>