diff --git wp-admin/includes/class-wp-themes-list-table.php wp-admin/includes/class-wp-themes-list-table.php
index 97ae61c..ceab971 100644
|
|
class WP_Themes_List_Table extends WP_List_Table { |
114 | 114 | function display_rows() { |
115 | 115 | $themes = $this->items; |
116 | 116 | $theme_names = array_keys( $themes ); |
| 117 | $page = $this->get_pagenum(); |
117 | 118 | natcasesort( $theme_names ); |
118 | 119 | |
119 | 120 | $table = array(); |
… |
… |
foreach ( $cols as $col => $theme_name ) { |
154 | 155 | $preview_text = esc_attr( sprintf( __( 'Preview of “%s”' ), $title ) ); |
155 | 156 | $tags = $themes[$theme_name]['Tags']; |
156 | 157 | $thickbox_class = 'thickbox thickbox-preview'; |
157 | | $activate_link = wp_nonce_url( "themes.php?action=activate&template=".urlencode( $template )."&stylesheet=".urlencode( $stylesheet ), 'switch-theme_' . $template ); |
| 158 | |
| 159 | $activate_link_args = array( |
| 160 | 'action' => 'activate', |
| 161 | 'template' => urlencode( $template ), |
| 162 | 'stylesheet' => urlencode( $stylesheet ), |
| 163 | ); |
| 164 | if ( $page > 1 ) |
| 165 | $activate_link_args['paged'] = $page; |
| 166 | |
| 167 | $activate_link = wp_nonce_url( add_query_arg( $activate_link_args, 'themes.php' ), "switch-theme_{$template}" ); |
158 | 168 | $activate_text = esc_attr( sprintf( __( 'Activate “%s”' ), $title ) ); |
159 | 169 | $actions = array(); |
160 | 170 | $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __( 'Activate' ) . '</a>'; |
diff --git wp-admin/themes.php wp-admin/themes.php
index ea36c4b..a8ac3e8 100644
|
|
if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { |
18 | 18 | if ( 'activate' == $_GET['action'] ) { |
19 | 19 | check_admin_referer('switch-theme_' . $_GET['template']); |
20 | 20 | switch_theme($_GET['template'], $_GET['stylesheet']); |
21 | | wp_redirect( admin_url('themes.php?activated=true') ); |
| 21 | $sendback = $wp_list_table->add_query_args( admin_url( 'themes.php?activated=true' ) ); |
| 22 | wp_redirect( $sendback ); |
22 | 23 | exit; |
23 | 24 | } elseif ( 'delete' == $_GET['action'] ) { |
24 | 25 | check_admin_referer('delete-theme_' . $_GET['template']); |
25 | 26 | if ( !current_user_can('delete_themes') ) |
26 | 27 | wp_die( __( 'Cheatin’ uh?' ) ); |
27 | 28 | delete_theme($_GET['template']); |
28 | | wp_redirect( admin_url('themes.php?deleted=true') ); |
| 29 | $sendback = $wp_list_table->add_query_args( admin_url( 'themes.php?deleted=true' ) ); |
| 30 | wp_redirect( $sendback ); |
29 | 31 | exit; |
30 | 32 | } |
31 | 33 | } |