92 |
92 |
93 $userfunction = 'all_spam'; |
93 $userfunction = 'all_spam'; |
94 $blogs = get_blogs_of_user( $user_id, true ); |
94 $blogs = get_blogs_of_user( $user_id, true ); |
95 |
95 |
96 foreach ( (array) $blogs as $details ) { |
96 foreach ( (array) $blogs as $details ) { |
97 if ( get_network()->site_id != $details->userblog_id ) { // Main blog is not a spam! |
97 if ( ! is_main_site( $details->userblog_id ) ) { // Main site is not a spam! |
98 update_blog_status( $details->userblog_id, 'spam', '1' ); |
98 update_blog_status( $details->userblog_id, 'spam', '1' ); |
99 } |
99 } |
100 } |
100 } |
101 |
101 |
102 $user_data = $user->to_array(); |
102 $user_data = $user->to_array(); |
238 ); |
238 ); |
239 |
239 |
240 get_current_screen()->set_help_sidebar( |
240 get_current_screen()->set_help_sidebar( |
241 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
241 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
242 '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' . |
242 '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' . |
243 '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>' |
243 '<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>' |
244 ); |
244 ); |
245 |
245 |
246 get_current_screen()->set_screen_reader_content( |
246 get_current_screen()->set_screen_reader_content( |
247 array( |
247 array( |
248 'heading_views' => __( 'Filter users list' ), |
248 'heading_views' => __( 'Filter users list' ), |
251 ) |
251 ) |
252 ); |
252 ); |
253 |
253 |
254 require_once ABSPATH . 'wp-admin/admin-header.php'; |
254 require_once ABSPATH . 'wp-admin/admin-header.php'; |
255 |
255 |
256 if ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) { |
256 if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) { |
257 ?> |
257 $message = ''; |
258 <div id="message" class="updated notice is-dismissible"><p> |
258 switch ( $_REQUEST['action'] ) { |
259 <?php |
259 case 'delete': |
260 switch ( $_REQUEST['action'] ) { |
260 $message = __( 'User deleted.' ); |
261 case 'delete': |
261 break; |
262 _e( 'User deleted.' ); |
262 case 'all_spam': |
263 break; |
263 $message = __( 'Users marked as spam.' ); |
264 case 'all_spam': |
264 break; |
265 _e( 'Users marked as spam.' ); |
265 case 'all_notspam': |
266 break; |
266 $message = __( 'Users removed from spam.' ); |
267 case 'all_notspam': |
267 break; |
268 _e( 'Users removed from spam.' ); |
268 case 'all_delete': |
269 break; |
269 $message = __( 'Users deleted.' ); |
270 case 'all_delete': |
270 break; |
271 _e( 'Users deleted.' ); |
271 case 'add': |
272 break; |
272 $message = __( 'User added.' ); |
273 case 'add': |
273 break; |
274 _e( 'User added.' ); |
274 } |
275 break; |
275 |
276 } |
276 wp_admin_notice( |
277 ?> |
277 $message, |
278 </p></div> |
278 array( |
279 <?php |
279 'type' => 'success', |
|
280 'dismissible' => true, |
|
281 'id' => 'message', |
|
282 ) |
|
283 ); |
280 } |
284 } |
281 ?> |
285 ?> |
282 <div class="wrap"> |
286 <div class="wrap"> |
283 <h1 class="wp-heading-inline"><?php esc_html_e( 'Users' ); ?></h1> |
287 <h1 class="wp-heading-inline"><?php esc_html_e( 'Users' ); ?></h1> |
284 |
288 |
285 <?php |
289 <?php |
286 if ( current_user_can( 'create_users' ) ) : |
290 if ( current_user_can( 'create_users' ) ) : |
287 ?> |
291 ?> |
288 <a href="<?php echo esc_url( network_admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a> |
292 <a href="<?php echo esc_url( network_admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add New User' ); ?></a> |
289 <?php |
293 <?php |
290 endif; |
294 endif; |
291 |
295 |
292 if ( strlen( $usersearch ) ) { |
296 if ( strlen( $usersearch ) ) { |
293 echo '<span class="subtitle">'; |
297 echo '<span class="subtitle">'; |