| 1 | Index: themes.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- themes.php (revision 15432) |
|---|
| 4 | +++ themes.php (working copy) |
|---|
| 5 | @@ -9,6 +9,12 @@ |
|---|
| 6 | /** WordPress Administration Bootstrap */ |
|---|
| 7 | require_once('./admin.php'); |
|---|
| 8 | |
|---|
| 9 | +if ( isset( $_GET['pagenum'] ) ) |
|---|
| 10 | + $page = absint( $_GET['pagenum'] ); |
|---|
| 11 | + |
|---|
| 12 | +if ( empty($page) ) |
|---|
| 13 | + $page = 1; |
|---|
| 14 | + |
|---|
| 15 | if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) |
|---|
| 16 | wp_die( __( 'Cheatin’ uh?' ) ); |
|---|
| 17 | |
|---|
| 18 | @@ -16,7 +22,12 @@ |
|---|
| 19 | if ( 'activate' == $_GET['action'] ) { |
|---|
| 20 | check_admin_referer('switch-theme_' . $_GET['template']); |
|---|
| 21 | switch_theme($_GET['template'], $_GET['stylesheet']); |
|---|
| 22 | - wp_redirect('themes.php?activated=true'); |
|---|
| 23 | + |
|---|
| 24 | + $activate_link_page = ''; |
|---|
| 25 | + if ( $page > 1 ) |
|---|
| 26 | + $activate_link_page = '&pagenum='.$page; |
|---|
| 27 | + |
|---|
| 28 | + wp_redirect('themes.php?activated=true'.$activate_link_page); |
|---|
| 29 | exit; |
|---|
| 30 | } else if ( 'delete' == $_GET['action'] ) { |
|---|
| 31 | check_admin_referer('delete-theme_' . $_GET['template']); |
|---|
| 32 | @@ -74,12 +85,6 @@ |
|---|
| 33 | $theme_total = count( $themes ); |
|---|
| 34 | $per_page = 15; |
|---|
| 35 | |
|---|
| 36 | -if ( isset( $_GET['pagenum'] ) ) |
|---|
| 37 | - $page = absint( $_GET['pagenum'] ); |
|---|
| 38 | - |
|---|
| 39 | -if ( empty($page) ) |
|---|
| 40 | - $page = 1; |
|---|
| 41 | - |
|---|
| 42 | $start = $offset = ( $page - 1 ) * $per_page; |
|---|
| 43 | |
|---|
| 44 | $page_links = paginate_links( array( |
|---|
| 45 | @@ -188,7 +193,10 @@ |
|---|
| 46 | $preview_text = esc_attr( sprintf( __('Preview of “%s”'), $title ) ); |
|---|
| 47 | $tags = $themes[$theme_name]['Tags']; |
|---|
| 48 | $thickbox_class = 'thickbox thickbox-preview'; |
|---|
| 49 | - $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template); |
|---|
| 50 | + $activate_link_page = ''; |
|---|
| 51 | + if ( $page > 1 ) |
|---|
| 52 | + $activate_link_page = '&pagenum='.$page; |
|---|
| 53 | + $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet).$activate_link_page, 'switch-theme_' . $template); |
|---|
| 54 | $activate_text = esc_attr( sprintf( __('Activate “%s”'), $title ) ); |
|---|
| 55 | $actions = array(); |
|---|
| 56 | $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>'; |
|---|