Ticket #14897: 14897.10.diff

File 14897.10.diff, 2.0 KB (added by PeteMall, 3 years ago)

Cleanup.

Line 
1Index: wp-admin/network/themes.php
2===================================================================
3--- wp-admin/network/themes.php (revision 16184)
4+++ wp-admin/network/themes.php (working copy)
5@@ -14,11 +14,10 @@
6 
7 $action = $wp_list_table->current_action();
8 
9-$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
10 $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
11 
12 // Clean up request URI from temporary args for screen options/paging uri's to work as expected.
13-$_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']);
14+$_SERVER['REQUEST_URI'] = remove_query_arg(array('network-enable', 'network-disable', 'network-enable-selected', 'network-disable-selected'), $_SERVER['REQUEST_URI']);
15 
16 if ( $action ) {
17        $allowed_themes = get_site_option( 'allowedthemes' );   
18@@ -36,8 +35,6 @@
19                        exit;
20                        break;
21                case 'network-enable-selected':
22-                       check_admin_referer('bulk-plugins');
23-
24                        $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
25                        if ( empty($themes) ) {
26                                wp_redirect( wp_get_referer() );
27@@ -47,19 +44,16 @@
28                                $allowed_themes[ $theme ] = 1;
29                        update_site_option( 'allowedthemes', $allowed_themes );
30                        break;
31-                       case 'network-disable-selected':
32-                               check_admin_referer('bulk-plugins');
33-
34-                               $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
35-                               if ( empty($themes) ) {
36-                                       wp_redirect( wp_get_referer() );
37-                                       exit;
38-                               }                                               
39-                               foreach( (array) $themes as $theme )
40-                                       unset( $allowed_themes[ $theme ] );
41-                               update_site_option( 'allowedthemes', $allowed_themes );
42-                               break;
43-
44+               case 'network-disable-selected':
45+                       $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
46+                       if ( empty($themes) ) {
47+                               wp_redirect( wp_get_referer() );
48+                               exit;
49+                       }                                               
50+                       foreach( (array) $themes as $theme )
51+                               unset( $allowed_themes[ $theme ] );
52+                       update_site_option( 'allowedthemes', $allowed_themes );
53+                       break;
54        }
55 }
56