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());
-
+
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('home') . '/'); ?></p></div>
+<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('url') . '/'); ?></p></div>
<?php endif; ?>
<?php
<?php if ( $ct->screenshot ) : ?>
<img src="<?php echo get_option('siteurl') . '/' . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
<?php endif; ?>
-<h3><?php printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h3>
+<h3><?php printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author) ; ?></h3>
<p><?php echo $ct->description; ?></p>
<?php if ($ct->parent_theme) { ?>
<p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p>
$author = $themes[$theme_name]['Author'];
$screenshot = $themes[$theme_name]['Screenshot'];
$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
- $activate_link = wp_nonce_url("themes.php?action=activate&template=$template&stylesheet=$stylesheet", 'switch-theme_' . $template);
+ $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
?>
<div class="available-theme">
-<h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3>
+<h3><a href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>
<a href="<?php echo $activate_link; ?>" class="screenshot">
<?php if ( $screenshot ) : ?>
</tr>
<?php
$theme = '';
-
+
$theme_names = array_keys($broken_themes);
natcasesort($theme_names);
$theme = ('class="alternate"' == $theme) ? '' : 'class="alternate"';
echo "
- <tr $theme>
- <td>$title</td>
- <td>$description</td>
- </tr>";
+ <tr $theme>
+ <td>$title</td>
+ <td>$description</td>
+ </tr>";
}
?>
</table>