]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/network/users.php
WordPress 4.7.2-scripts
[autoinstalls/wordpress.git] / wp-admin / network / users.php
index cc3edc2ca34e29076ef9fc1819218ac6c0ea394a..90ece927dca6a7c1bb505a9017925f34f359d2a4 100644 (file)
@@ -10,9 +10,6 @@
 /** Load WordPress Administration Bootstrap */
 require_once( dirname( __FILE__ ) . '/admin.php' );
 
 /** Load WordPress Administration Bootstrap */
 require_once( dirname( __FILE__ ) . '/admin.php' );
 
-if ( ! is_multisite() )
-       wp_die( __( 'Multisite support is not enabled.' ) );
-
 if ( ! current_user_can( 'manage_network_users' ) )
        wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
 
 if ( ! current_user_can( 'manage_network_users' ) )
        wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
 
@@ -75,7 +72,7 @@ if ( isset( $_GET['action'] ) ) {
                                                                $userfunction = 'all_spam';
                                                                $blogs = get_blogs_of_user( $user_id, true );
                                                                foreach ( (array) $blogs as $details ) {
                                                                $userfunction = 'all_spam';
                                                                $blogs = get_blogs_of_user( $user_id, true );
                                                                foreach ( (array) $blogs as $details ) {
-                                                                       if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
+                                                                       if ( $details->userblog_id != get_network()->site_id ) // main blog not a spam !
                                                                                update_blog_status( $details->userblog_id, 'spam', '1' );
                                                                }
                                                                update_user_status( $user_id, 'spam', '1' );
                                                                                update_blog_status( $details->userblog_id, 'spam', '1' );
                                                                }
                                                                update_user_status( $user_id, 'spam', '1' );
@@ -93,6 +90,17 @@ if ( isset( $_GET['action'] ) ) {
                                        }
                                }
 
                                        }
                                }
 
+                               if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {
+                                       $sendback = wp_get_referer();
+
+                                       $user_ids = (array) $_POST['allusers'];
+                                       /** This action is documented in wp-admin/network/site-themes.php */
+                                       $sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids );
+
+                                       wp_safe_redirect( $sendback );
+                                       exit();
+                               }
+
                                wp_safe_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
                        } else {
                                $location = network_admin_url( 'users.php' );
                                wp_safe_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
                        } else {
                                $location = network_admin_url( 'users.php' );
@@ -168,8 +176,8 @@ get_current_screen()->add_help_tab( array(
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
-       '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
-       '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+       '<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>') . '</p>' .
+       '<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
 );
 
 get_current_screen()->set_screen_reader_content( array(
 );
 
 get_current_screen()->set_screen_reader_content( array(