Completed
Push — master ( d99bf9...491baf )
by Stephen
13:47
created
src/wp-admin/network/site-users.php 4 patches
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -203,36 +203,36 @@
 block discarded – undo
203 203
 
204 204
 if ( isset($_GET['update']) ) :
205 205
 	switch($_GET['update']) {
206
-	case 'adduser':
207
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
208
-		break;
209
-	case 'err_add_member':
210
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
211
-		break;
212
-	case 'err_add_notfound':
213
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
214
-		break;
215
-	case 'promote':
216
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
217
-		break;
218
-	case 'err_promote':
219
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
220
-		break;
221
-	case 'remove':
222
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
223
-		break;
224
-	case 'err_remove':
225
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
226
-		break;
227
-	case 'newuser':
228
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
229
-		break;
230
-	case 'err_new':
231
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
232
-		break;
233
-	case 'err_new_dup':
234
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
235
-		break;
206
+		case 'adduser':
207
+			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
208
+			break;
209
+		case 'err_add_member':
210
+			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
211
+			break;
212
+		case 'err_add_notfound':
213
+			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
214
+			break;
215
+		case 'promote':
216
+			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
217
+			break;
218
+		case 'err_promote':
219
+			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
220
+			break;
221
+		case 'remove':
222
+			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
223
+			break;
224
+		case 'err_remove':
225
+			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
226
+			break;
227
+		case 'newuser':
228
+			echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
229
+			break;
230
+		case 'err_new':
231
+			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
232
+			break;
233
+		case 'err_new_dup':
234
+			echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
235
+			break;
236 236
 	}
237 237
 endif; ?>
238 238
 
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,12 +86,12 @@
 block discarded – undo
86 86
 					add_user_to_blog( $id, $user_id, $_POST['new_role'] );
87 87
 					$update = 'newuser';
88 88
 					/**
89
-					  * Fires after a user has been created via the network site-users.php page.
90
-					  *
91
-					  * @since 4.4.0
92
-					  *
93
-					  * @param int $user_id ID of the newly created user.
94
-					  */
89
+					 * Fires after a user has been created via the network site-users.php page.
90
+					 *
91
+					 * @since 4.4.0
92
+					 *
93
+					 * @param int $user_id ID of the newly created user.
94
+					 */
95 95
 					do_action( 'network_site_users_created_user', $user_id );
96 96
 				}
97 97
 			}
Please login to merge, or discard this patch.
Braces   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@  discard block
 block discarded – undo
10 10
 /** Load WordPress Administration Bootstrap */
11 11
 require_once( dirname( __FILE__ ) . '/admin.php' );
12 12
 
13
-if ( ! current_user_can('manage_sites') )
13
+if ( ! current_user_can('manage_sites') ) {
14 14
 	wp_die(__('Sorry, you are not allowed to edit this site.'));
15
+}
15 16
 
16 17
 $wp_list_table = _get_list_table('WP_Users_List_Table');
17 18
 $wp_list_table->prepare_items();
@@ -48,16 +49,18 @@  discard block
 block discarded – undo
48 49
 
49 50
 $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
50 51
 
51
-if ( ! $id )
52
+if ( ! $id ) {
52 53
 	wp_die( __('Invalid site ID.') );
54
+}
53 55
 
54 56
 $details = get_site( $id );
55 57
 if ( ! $details ) {
56 58
 	wp_die( __( 'The requested site does not exist.' ) );
57 59
 }
58 60
 
59
-if ( ! can_edit_network( $details->site_id ) )
61
+if ( ! can_edit_network( $details->site_id ) ) {
60 62
 	wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
63
+}
61 64
 
62 65
 $is_main_site = is_main_site( $id );
63 66
 
@@ -101,10 +104,11 @@  discard block
 block discarded – undo
101 104
 				$newuser = $_POST['newuser'];
102 105
 				$user = get_user_by( 'login', $newuser );
103 106
 				if ( $user && $user->exists() ) {
104
-					if ( ! is_user_member_of_blog( $user->ID, $id ) )
105
-						add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
106
-					else
107
-						$update = 'err_add_member';
107
+					if ( ! is_user_member_of_blog( $user->ID, $id ) ) {
108
+											add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
109
+					} else {
110
+											$update = 'err_add_member';
111
+					}
108 112
 				} else {
109 113
 					$update = 'err_add_notfound';
110 114
 				}
@@ -202,8 +206,9 @@  discard block
 block discarded – undo
202 206
  *
203 207
  * @param bool $bool Whether to show the Add Existing User form. Default true.
204 208
  */
205
-if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) )
209
+if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) {
206 210
 	wp_enqueue_script( 'user-suggest' );
211
+}
207 212
 
208 213
 require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
209 214
 
Please login to merge, or discard this patch.
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -8,79 +8,79 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 /** Load WordPress Administration Bootstrap */
11
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
+require_once(dirname(__FILE__).'/admin.php');
12 12
 
13
-if ( ! current_user_can('manage_sites') )
13
+if ( ! current_user_can('manage_sites'))
14 14
 	wp_die(__('Sorry, you are not allowed to edit this site.'));
15 15
 
16 16
 $wp_list_table = _get_list_table('WP_Users_List_Table');
17 17
 $wp_list_table->prepare_items();
18 18
 
19
-get_current_screen()->add_help_tab( array(
19
+get_current_screen()->add_help_tab(array(
20 20
 	'id'      => 'overview',
21 21
 	'title'   => __('Overview'),
22 22
 	'content' =>
23
-		'<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
24
-		'<p>' . __('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
25
-		'<p>' . __('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
26
-		'<p>' . sprintf( __('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
27
-		'<p>' . __('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
28
-) );
23
+		'<p>'.__('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.').'</p>'.
24
+		'<p>'.__('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.').'</p>'.
25
+		'<p>'.__('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.').'</p>'.
26
+		'<p>'.sprintf(__('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.'), network_admin_url('themes.php')).'</p>'.
27
+		'<p>'.__('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.').'</p>'
28
+));
29 29
 
30 30
 get_current_screen()->set_help_sidebar(
31
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
32
-	'<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
33
-	'<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
31
+	'<p><strong>'.__('For more information:').'</strong></p>'.
32
+	'<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>').'</p>'.
33
+	'<p>'.__('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>').'</p>'
34 34
 );
35 35
 
36
-get_current_screen()->set_screen_reader_content( array(
37
-	'heading_views'      => __( 'Filter site users list' ),
38
-	'heading_pagination' => __( 'Site users list navigation' ),
39
-	'heading_list'       => __( 'Site users list' ),
40
-) );
36
+get_current_screen()->set_screen_reader_content(array(
37
+	'heading_views'      => __('Filter site users list'),
38
+	'heading_pagination' => __('Site users list navigation'),
39
+	'heading_list'       => __('Site users list'),
40
+));
41 41
 
42
-$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );
43
-$referer = remove_query_arg( 'update', wp_get_referer() );
42
+$_SERVER['REQUEST_URI'] = remove_query_arg('update', $_SERVER['REQUEST_URI']);
43
+$referer = remove_query_arg('update', wp_get_referer());
44 44
 
45
-if ( ! empty( $_REQUEST['paged'] ) ) {
46
-	$referer = add_query_arg( 'paged', (int) $_REQUEST['paged'], $referer );
45
+if ( ! empty($_REQUEST['paged'])) {
46
+	$referer = add_query_arg('paged', (int) $_REQUEST['paged'], $referer);
47 47
 }
48 48
 
49
-$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
49
+$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
50 50
 
51
-if ( ! $id )
52
-	wp_die( __('Invalid site ID.') );
51
+if ( ! $id)
52
+	wp_die(__('Invalid site ID.'));
53 53
 
54
-$details = get_site( $id );
55
-if ( ! $details ) {
56
-	wp_die( __( 'The requested site does not exist.' ) );
54
+$details = get_site($id);
55
+if ( ! $details) {
56
+	wp_die(__('The requested site does not exist.'));
57 57
 }
58 58
 
59
-if ( ! can_edit_network( $details->site_id ) )
60
-	wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
59
+if ( ! can_edit_network($details->site_id))
60
+	wp_die(__('Sorry, you are not allowed to access this page.'), 403);
61 61
 
62
-$is_main_site = is_main_site( $id );
62
+$is_main_site = is_main_site($id);
63 63
 
64
-switch_to_blog( $id );
64
+switch_to_blog($id);
65 65
 
66 66
 $action = $wp_list_table->current_action();
67 67
 
68
-if ( $action ) {
68
+if ($action) {
69 69
 
70
-	switch ( $action ) {
70
+	switch ($action) {
71 71
 		case 'newuser':
72
-			check_admin_referer( 'add-user', '_wpnonce_add-new-user' );
72
+			check_admin_referer('add-user', '_wpnonce_add-new-user');
73 73
 			$user = $_POST['user'];
74
-			if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {
74
+			if ( ! is_array($_POST['user']) || empty($user['username']) || empty($user['email'])) {
75 75
 				$update = 'err_new';
76 76
 			} else {
77
-				$password = wp_generate_password( 12, false);
78
-				$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
77
+				$password = wp_generate_password(12, false);
78
+				$user_id = wpmu_create_user(esc_html(strtolower($user['username'])), $password, esc_html($user['email']));
79 79
 
80
-				if ( false === $user_id ) {
80
+				if (false === $user_id) {
81 81
 		 			$update = 'err_new_dup';
82 82
 				} else {
83
-					add_user_to_blog( $id, $user_id, $_POST['new_role'] );
83
+					add_user_to_blog($id, $user_id, $_POST['new_role']);
84 84
 					$update = 'newuser';
85 85
 					/**
86 86
 					  * Fires after a user has been created via the network site-users.php page.
@@ -89,20 +89,20 @@  discard block
 block discarded – undo
89 89
 					  *
90 90
 					  * @param int $user_id ID of the newly created user.
91 91
 					  */
92
-					do_action( 'network_site_users_created_user', $user_id );
92
+					do_action('network_site_users_created_user', $user_id);
93 93
 				}
94 94
 			}
95 95
 			break;
96 96
 
97 97
 		case 'adduser':
98
-			check_admin_referer( 'add-user', '_wpnonce_add-user' );
99
-			if ( !empty( $_POST['newuser'] ) ) {
98
+			check_admin_referer('add-user', '_wpnonce_add-user');
99
+			if ( ! empty($_POST['newuser'])) {
100 100
 				$update = 'adduser';
101 101
 				$newuser = $_POST['newuser'];
102
-				$user = get_user_by( 'login', $newuser );
103
-				if ( $user && $user->exists() ) {
104
-					if ( ! is_user_member_of_blog( $user->ID, $id ) )
105
-						add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
102
+				$user = get_user_by('login', $newuser);
103
+				if ($user && $user->exists()) {
104
+					if ( ! is_user_member_of_blog($user->ID, $id))
105
+						add_user_to_blog($id, $user->ID, $_POST['new_role']);
106 106
 					else
107 107
 						$update = 'err_add_member';
108 108
 				} else {
@@ -114,90 +114,90 @@  discard block
 block discarded – undo
114 114
 			break;
115 115
 
116 116
 		case 'remove':
117
-			if ( ! current_user_can( 'remove_users' ) ) {
118
-				wp_die( __( 'Sorry, you are not allowed to remove users.' ) );
117
+			if ( ! current_user_can('remove_users')) {
118
+				wp_die(__('Sorry, you are not allowed to remove users.'));
119 119
 			}
120 120
 
121
-			check_admin_referer( 'bulk-users' );
121
+			check_admin_referer('bulk-users');
122 122
 
123 123
 			$update = 'remove';
124
-			if ( isset( $_REQUEST['users'] ) ) {
124
+			if (isset($_REQUEST['users'])) {
125 125
 				$userids = $_REQUEST['users'];
126 126
 
127
-				foreach ( $userids as $user_id ) {
127
+				foreach ($userids as $user_id) {
128 128
 					$user_id = (int) $user_id;
129
-					remove_user_from_blog( $user_id, $id );
129
+					remove_user_from_blog($user_id, $id);
130 130
 				}
131
-			} elseif ( isset( $_GET['user'] ) ) {
132
-				remove_user_from_blog( $_GET['user'] );
131
+			} elseif (isset($_GET['user'])) {
132
+				remove_user_from_blog($_GET['user']);
133 133
 			} else {
134 134
 				$update = 'err_remove';
135 135
 			}
136 136
 			break;
137 137
 
138 138
 		case 'promote':
139
-			check_admin_referer( 'bulk-users' );
139
+			check_admin_referer('bulk-users');
140 140
 			$editable_roles = get_editable_roles();
141 141
 			$role = false;
142
-			if ( ! empty( $_REQUEST['new_role2'] ) ) {
142
+			if ( ! empty($_REQUEST['new_role2'])) {
143 143
 				$role = $_REQUEST['new_role2'];
144
-			} elseif ( ! empty( $_REQUEST['new_role'] ) ) {
144
+			} elseif ( ! empty($_REQUEST['new_role'])) {
145 145
 				$role = $_REQUEST['new_role'];
146 146
 			}
147 147
 
148
-			if ( empty( $editable_roles[ $role ] ) ) {
149
-				wp_die( __( 'Sorry, you are not allowed to give users that role.' ) );
148
+			if (empty($editable_roles[$role])) {
149
+				wp_die(__('Sorry, you are not allowed to give users that role.'));
150 150
 			}
151 151
 
152
-			if ( isset( $_REQUEST['users'] ) ) {
152
+			if (isset($_REQUEST['users'])) {
153 153
 				$userids = $_REQUEST['users'];
154 154
 				$update = 'promote';
155
-				foreach ( $userids as $user_id ) {
155
+				foreach ($userids as $user_id) {
156 156
 					$user_id = (int) $user_id;
157 157
 
158 158
 					// If the user doesn't already belong to the blog, bail.
159
-					if ( ! is_user_member_of_blog( $user_id ) ) {
159
+					if ( ! is_user_member_of_blog($user_id)) {
160 160
 						wp_die(
161
-							'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
162
-							'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
161
+							'<h1>'.__('Cheatin&#8217; uh?').'</h1>'.
162
+							'<p>'.__('One of the selected users is not a member of this site.').'</p>',
163 163
 							403
164 164
 						);
165 165
 					}
166 166
 
167
-					$user = get_userdata( $user_id );
168
-					$user->set_role( $role );
167
+					$user = get_userdata($user_id);
168
+					$user->set_role($role);
169 169
 				}
170 170
 			} else {
171 171
 				$update = 'err_promote';
172 172
 			}
173 173
 			break;
174 174
 		default:
175
-			if ( ! isset( $_REQUEST['users'] ) ) {
175
+			if ( ! isset($_REQUEST['users'])) {
176 176
 				break;
177 177
 			}
178
-			check_admin_referer( 'bulk-users' );
178
+			check_admin_referer('bulk-users');
179 179
 			$userids = $_REQUEST['users'];
180 180
 			/** This action is documented in wp-admin/network/site-themes.php */
181
-			$referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id );
181
+			$referer = apply_filters('handle_network_bulk_actions-'.get_current_screen()->id, $referer, $action, $userids, $id);
182 182
 			$update = $action;
183 183
 			break;
184 184
 	}
185 185
 
186
-	wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
186
+	wp_safe_redirect(add_query_arg('update', $update, $referer));
187 187
 	exit();
188 188
 }
189 189
 
190 190
 restore_current_blog();
191 191
 
192
-if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
193
-	wp_safe_redirect( $referer );
192
+if (isset($_GET['action']) && 'update-site' == $_GET['action']) {
193
+	wp_safe_redirect($referer);
194 194
 	exit();
195 195
 }
196 196
 
197
-add_screen_option( 'per_page' );
197
+add_screen_option('per_page');
198 198
 
199 199
 /* translators: %s: site name */
200
-$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
200
+$title = sprintf(__('Edit Site: %s'), esc_html($details->blogname));
201 201
 
202 202
 $parent_file = 'sites.php';
203 203
 $submenu_file = 'sites.php';
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
  *
210 210
  * @param bool $bool Whether to show the Add Existing User form. Default true.
211 211
  */
212
-if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) )
213
-	wp_enqueue_script( 'user-suggest' );
212
+if ( ! wp_is_large_network('users') && apply_filters('show_network_site_users_add_existing_form', true))
213
+	wp_enqueue_script('user-suggest');
214 214
 
215
-require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
215
+require(ABSPATH.'wp-admin/admin-header.php'); ?>
216 216
 
217 217
 <script type="text/javascript">
218 218
 var current_site_id = <?php echo $id; ?>;
@@ -221,58 +221,58 @@  discard block
 block discarded – undo
221 221
 
222 222
 <div class="wrap">
223 223
 <h1 id="edit-site"><?php echo $title; ?></h1>
224
-<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
224
+<p class="edit-site-actions"><a href="<?php echo esc_url(get_home_url($id, '/')); ?>"><?php _e('Visit'); ?></a> | <a href="<?php echo esc_url(get_admin_url($id)); ?>"><?php _e('Dashboard'); ?></a></p>
225 225
 <?php
226 226
 
227
-network_edit_site_nav( array(
227
+network_edit_site_nav(array(
228 228
 	'blog_id'  => $id,
229 229
 	'selected' => 'site-users'
230
-) );
230
+));
231 231
 
232
-if ( isset($_GET['update']) ) :
233
-	switch($_GET['update']) {
232
+if (isset($_GET['update'])) :
233
+	switch ($_GET['update']) {
234 234
 	case 'adduser':
235
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
235
+		echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User added.').'</p></div>';
236 236
 		break;
237 237
 	case 'err_add_member':
238
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
238
+		echo '<div id="message" class="error notice is-dismissible"><p>'.__('User is already a member of this site.').'</p></div>';
239 239
 		break;
240 240
 	case 'err_add_notfound':
241
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
241
+		echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username of an existing user.').'</p></div>';
242 242
 		break;
243 243
 	case 'promote':
244
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
244
+		echo '<div id="message" class="updated notice is-dismissible"><p>'.__('Changed roles.').'</p></div>';
245 245
 		break;
246 246
 	case 'err_promote':
247
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
247
+		echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to change role.').'</p></div>';
248 248
 		break;
249 249
 	case 'remove':
250
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
250
+		echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User removed from this site.').'</p></div>';
251 251
 		break;
252 252
 	case 'err_remove':
253
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
253
+		echo '<div id="message" class="error notice is-dismissible"><p>'.__('Select a user to remove.').'</p></div>';
254 254
 		break;
255 255
 	case 'newuser':
256
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
256
+		echo '<div id="message" class="updated notice is-dismissible"><p>'.__('User created.').'</p></div>';
257 257
 		break;
258 258
 	case 'err_new':
259
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
259
+		echo '<div id="message" class="error notice is-dismissible"><p>'.__('Enter the username and email.').'</p></div>';
260 260
 		break;
261 261
 	case 'err_new_dup':
262
-		echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
262
+		echo '<div id="message" class="error notice is-dismissible"><p>'.__('Duplicated username or email address.').'</p></div>';
263 263
 		break;
264 264
 	}
265 265
 endif; ?>
266 266
 
267 267
 <form class="search-form" method="get">
268
-<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
269
-<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
268
+<?php $wp_list_table->search_box(__('Search Users'), 'user'); ?>
269
+<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
270 270
 </form>
271 271
 
272 272
 <?php $wp_list_table->views(); ?>
273 273
 
274 274
 <form method="post" action="site-users.php?action=update-site">
275
-	<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
275
+	<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
276 276
 
277 277
 <?php $wp_list_table->display(); ?>
278 278
 
@@ -284,27 +284,27 @@  discard block
 block discarded – undo
284 284
  *
285 285
  * @since 3.1.0
286 286
  */
287
-do_action( 'network_site_users_after_list_table' );
287
+do_action('network_site_users_after_list_table');
288 288
 
289 289
 /** This filter is documented in wp-admin/network/site-users.php */
290
-if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?>
291
-<h2 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h2>
290
+if (current_user_can('promote_users') && apply_filters('show_network_site_users_add_existing_form', true)) : ?>
291
+<h2 id="add-existing-user"><?php _e('Add Existing User'); ?></h2>
292 292
 <form action="site-users.php?action=adduser" id="adduser" method="post">
293
-	<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
293
+	<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
294 294
 	<table class="form-table">
295 295
 		<tr>
296
-			<th scope="row"><label for="newuser"><?php _e( 'Username' ); ?></label></th>
296
+			<th scope="row"><label for="newuser"><?php _e('Username'); ?></label></th>
297 297
 			<td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td>
298 298
 		</tr>
299 299
 		<tr>
300
-			<th scope="row"><label for="new_role_adduser"><?php _e( 'Role' ); ?></label></th>
300
+			<th scope="row"><label for="new_role_adduser"><?php _e('Role'); ?></label></th>
301 301
 			<td><select name="new_role" id="new_role_adduser">
302
-			<?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
302
+			<?php wp_dropdown_roles(get_option('default_role')); ?>
303 303
 			</select></td>
304 304
 		</tr>
305 305
 	</table>
306
-	<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
307
-	<?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?>
306
+	<?php wp_nonce_field('add-user', '_wpnonce_add-user') ?>
307
+	<?php submit_button(__('Add User'), 'primary', 'add-user', true, array('id' => 'submit-add-existing-user')); ?>
308 308
 </form>
309 309
 <?php endif; ?>
310 310
 
@@ -316,33 +316,33 @@  discard block
 block discarded – undo
316 316
  *
317 317
  * @param bool $bool Whether to show the Add New User form. Default true.
318 318
  */
319
-if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?>
320
-<h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2>
319
+if (current_user_can('create_users') && apply_filters('show_network_site_users_add_new_form', true)) : ?>
320
+<h2 id="add-new-user"><?php _e('Add New User'); ?></h2>
321 321
 <form action="<?php echo network_admin_url('site-users.php?action=newuser'); ?>" id="newuser" method="post">
322
-	<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
322
+	<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
323 323
 	<table class="form-table">
324 324
 		<tr>
325
-			<th scope="row"><label for="user_username"><?php _e( 'Username' ) ?></label></th>
325
+			<th scope="row"><label for="user_username"><?php _e('Username') ?></label></th>
326 326
 			<td><input type="text" class="regular-text" name="user[username]" id="user_username" /></td>
327 327
 		</tr>
328 328
 		<tr>
329
-			<th scope="row"><label for="user_email"><?php _e( 'Email' ) ?></label></th>
329
+			<th scope="row"><label for="user_email"><?php _e('Email') ?></label></th>
330 330
 			<td><input type="text" class="regular-text" name="user[email]" id="user_email" /></td>
331 331
 		</tr>
332 332
 		<tr>
333
-			<th scope="row"><label for="new_role_newuser"><?php _e( 'Role' ); ?></label></th>
333
+			<th scope="row"><label for="new_role_newuser"><?php _e('Role'); ?></label></th>
334 334
 			<td><select name="new_role" id="new_role_newuser">
335
-			<?php wp_dropdown_roles( get_option( 'default_role' ) ); ?>
335
+			<?php wp_dropdown_roles(get_option('default_role')); ?>
336 336
 			</select></td>
337 337
 		</tr>
338 338
 		<tr class="form-field">
339
-			<td colspan="2"><?php _e( 'A password reset link will be sent to the user via email.' ) ?></td>
339
+			<td colspan="2"><?php _e('A password reset link will be sent to the user via email.') ?></td>
340 340
 		</tr>
341 341
 	</table>
342
-	<?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?>
343
-	<?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?>
342
+	<?php wp_nonce_field('add-user', '_wpnonce_add-new-user') ?>
343
+	<?php submit_button(__('Add New User'), 'primary', 'add-user', true, array('id' => 'submit-add-user')); ?>
344 344
 </form>
345 345
 <?php endif; ?>
346 346
 </div>
347 347
 <?php
348
-require( ABSPATH . 'wp-admin/admin-footer.php' );
348
+require(ABSPATH.'wp-admin/admin-footer.php');
Please login to merge, or discard this patch.
src/wp-admin/ms-admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * @since 3.0.0
8 8
  */
9 9
 
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12
-wp_redirect( network_admin_url() );
12
+wp_redirect(network_admin_url());
13 13
 exit;
Please login to merge, or discard this patch.
src/wp-admin/link.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,18 +10,18 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 /** Load WordPress Administration Bootstrap */
13
-require_once( dirname( __FILE__ ) . '/admin.php' );
13
+require_once(dirname(__FILE__).'/admin.php');
14 14
 
15
-wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
15
+wp_reset_vars(array('action', 'cat_id', 'link_id'));
16 16
 
17
-if ( ! current_user_can('manage_links') )
17
+if ( ! current_user_can('manage_links'))
18 18
 	wp_link_manager_disabled_message();
19 19
 
20
-if ( !empty($_POST['deletebookmarks']) )
20
+if ( ! empty($_POST['deletebookmarks']))
21 21
 	$action = 'deletebookmarks';
22
-if ( !empty($_POST['move']) )
22
+if ( ! empty($_POST['move']))
23 23
 	$action = 'move';
24
-if ( !empty($_POST['linkcheck']) )
24
+if ( ! empty($_POST['linkcheck']))
25 25
 	$linkcheck = $_POST['linkcheck'];
26 26
 
27 27
 $this_file = admin_url('link-manager.php');
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		foreach ($linkcheck as $link_id) {
41 41
 			$link_id = (int) $link_id;
42 42
 
43
-			if ( wp_delete_link($link_id) )
43
+			if (wp_delete_link($link_id))
44 44
 				$deleted++;
45 45
 		}
46 46
 
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 		check_admin_referer('add-bookmark');
69 69
 
70 70
 		$redir = wp_get_referer();
71
-		if ( add_link() )
72
-			$redir = add_query_arg( 'added', 'true', $redir );
71
+		if (add_link())
72
+			$redir = add_query_arg('added', 'true', $redir);
73 73
 
74
-		wp_redirect( $redir );
74
+		wp_redirect($redir);
75 75
 		exit;
76 76
 
77 77
 	case 'save' :
78 78
 		$link_id = (int) $_POST['link_id'];
79
-		check_admin_referer('update-bookmark_' . $link_id);
79
+		check_admin_referer('update-bookmark_'.$link_id);
80 80
 
81 81
 		edit_link($link_id);
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	case 'delete' :
87 87
 		$link_id = (int) $_GET['link_id'];
88
-		check_admin_referer('delete-bookmark_' . $link_id);
88
+		check_admin_referer('delete-bookmark_'.$link_id);
89 89
 
90 90
 		wp_delete_link($link_id);
91 91
 
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 		wp_enqueue_script('link');
97 97
 		wp_enqueue_script('xfn');
98 98
 
99
-		if ( wp_is_mobile() )
100
-			wp_enqueue_script( 'jquery-touch-punch' );
99
+		if (wp_is_mobile())
100
+			wp_enqueue_script('jquery-touch-punch');
101 101
 
102 102
 		$parent_file = 'link-manager.php';
103 103
 		$submenu_file = 'link-manager.php';
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 
106 106
 		$link_id = (int) $_GET['link_id'];
107 107
 
108
-		if (!$link = get_link_to_edit($link_id))
108
+		if ( ! $link = get_link_to_edit($link_id))
109 109
 			wp_die(__('Link not found.'));
110 110
 
111
-		include( ABSPATH . 'wp-admin/edit-link-form.php' );
112
-		include( ABSPATH . 'wp-admin/admin-footer.php' );
111
+		include(ABSPATH.'wp-admin/edit-link-form.php');
112
+		include(ABSPATH.'wp-admin/admin-footer.php');
113 113
 		break;
114 114
 
115 115
 	default :
Please login to merge, or discard this patch.
Braces   +20 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,15 +14,19 @@  discard block
 block discarded – undo
14 14
 
15 15
 wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
16 16
 
17
-if ( ! current_user_can('manage_links') )
17
+if ( ! current_user_can('manage_links') ) {
18 18
 	wp_link_manager_disabled_message();
19
+}
19 20
 
20
-if ( !empty($_POST['deletebookmarks']) )
21
+if ( !empty($_POST['deletebookmarks']) ) {
21 22
 	$action = 'deletebookmarks';
22
-if ( !empty($_POST['move']) )
23
+}
24
+if ( !empty($_POST['move']) ) {
23 25
 	$action = 'move';
24
-if ( !empty($_POST['linkcheck']) )
26
+}
27
+if ( !empty($_POST['linkcheck']) ) {
25 28
 	$linkcheck = $_POST['linkcheck'];
29
+}
26 30
 
27 31
 $this_file = admin_url('link-manager.php');
28 32
 
@@ -40,8 +44,9 @@  discard block
 block discarded – undo
40 44
 		foreach ($linkcheck as $link_id) {
41 45
 			$link_id = (int) $link_id;
42 46
 
43
-			if ( wp_delete_link($link_id) )
44
-				$deleted++;
47
+			if ( wp_delete_link($link_id) ) {
48
+							$deleted++;
49
+			}
45 50
 		}
46 51
 
47 52
 		wp_redirect("$this_file?deleted=$deleted");
@@ -68,8 +73,9 @@  discard block
 block discarded – undo
68 73
 		check_admin_referer('add-bookmark');
69 74
 
70 75
 		$redir = wp_get_referer();
71
-		if ( add_link() )
72
-			$redir = add_query_arg( 'added', 'true', $redir );
76
+		if ( add_link() ) {
77
+					$redir = add_query_arg( 'added', 'true', $redir );
78
+		}
73 79
 
74 80
 		wp_redirect( $redir );
75 81
 		exit;
@@ -96,8 +102,9 @@  discard block
 block discarded – undo
96 102
 		wp_enqueue_script('link');
97 103
 		wp_enqueue_script('xfn');
98 104
 
99
-		if ( wp_is_mobile() )
100
-			wp_enqueue_script( 'jquery-touch-punch' );
105
+		if ( wp_is_mobile() ) {
106
+					wp_enqueue_script( 'jquery-touch-punch' );
107
+		}
101 108
 
102 109
 		$parent_file = 'link-manager.php';
103 110
 		$submenu_file = 'link-manager.php';
@@ -105,8 +112,9 @@  discard block
 block discarded – undo
105 112
 
106 113
 		$link_id = (int) $_GET['link_id'];
107 114
 
108
-		if (!$link = get_link_to_edit($link_id))
109
-			wp_die(__('Link not found.'));
115
+		if (!$link = get_link_to_edit($link_id)) {
116
+					wp_die(__('Link not found.'));
117
+		}
110 118
 
111 119
 		include( ABSPATH . 'wp-admin/edit-link-form.php' );
112 120
 		include( ABSPATH . 'wp-admin/admin-footer.php' );
Please login to merge, or discard this patch.
src/wp-admin/moderation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,6 +7,6 @@
 block discarded – undo
7 7
  * @package WordPress
8 8
  * @subpackage Administration
9 9
  */
10
-require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
11
-wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
10
+require_once(dirname(dirname(__FILE__)).'/wp-load.php');
11
+wp_redirect(admin_url('edit-comments.php?comment_status=moderated'));
12 12
 exit;
Please login to merge, or discard this patch.
src/wp-admin/ms-sites.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * @since 3.0.0
8 8
  */
9 9
 
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12
-wp_redirect( network_admin_url('sites.php') );
12
+wp_redirect(network_admin_url('sites.php'));
13 13
 exit;
Please login to merge, or discard this patch.
src/wp-admin/user/user-edit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 /** Load WordPress Administration Bootstrap */
11
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
+require_once(dirname(__FILE__).'/admin.php');
12 12
 
13
-require( ABSPATH . 'wp-admin/user-edit.php' );
13
+require(ABSPATH.'wp-admin/user-edit.php');
Please login to merge, or discard this patch.
src/wp-admin/user/credits.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 /** Load WordPress Administration Bootstrap */
11
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
+require_once(dirname(__FILE__).'/admin.php');
12 12
 
13
-require( ABSPATH . 'wp-admin/credits.php' );
13
+require(ABSPATH.'wp-admin/credits.php');
Please login to merge, or discard this patch.
src/wp-admin/user/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 /** Load WordPress Administration Bootstrap */
11
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
+require_once(dirname(__FILE__).'/admin.php');
12 12
 
13
-require( ABSPATH . 'wp-admin/index.php' );
13
+require(ABSPATH.'wp-admin/index.php');
Please login to merge, or discard this patch.
src/wp-admin/user/menu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
 
10 10
 $menu[2] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard');
11 11
 
12
-$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );
12
+$menu[4] = array('', 'exist', 'separator1', '', 'wp-menu-separator');
13 13
 
14
-$menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
14
+$menu[70] = array(__('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users');
15 15
 
16
-$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
16
+$menu[99] = array('', 'exist', 'separator-last', '', 'wp-menu-separator');
17 17
 
18 18
 $_wp_real_parent_file['users.php'] = 'profile.php';
19 19
 $compat = array();
20 20
 $submenu = array();
21 21
 
22
-require_once(ABSPATH . 'wp-admin/includes/menu.php');
22
+require_once(ABSPATH.'wp-admin/includes/menu.php');
Please login to merge, or discard this patch.