<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16560] trunk/wp-admin: Adapt user-list-table for network admin site-users.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16560">16560</a></dd>
<dt>Author</dt> <dd>PeteMall</dd>
<dt>Date</dt> <dd>2010-11-24 05:31:25 +0000 (Wed, 24 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Adapt user-list-table for network admin site-users. See <a href="http://trac.wordpress.org/ticket/15558">#15558</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpuserslisttablephp">trunk/wp-admin/includes/class-wp-users-list-table.php</a></li>
<li><a href="#trunkwpadminnetworksiteusersphp">trunk/wp-admin/network/site-users.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswpuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-users-list-table.php (16559 => 16560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-users-list-table.php        2010-11-24 00:27:54 UTC (rev 16559)
+++ trunk/wp-admin/includes/class-wp-users-list-table.php        2010-11-24 05:31:25 UTC (rev 16560)
</span><span class="lines">@@ -7,10 +7,29 @@
</span><span class="cx">  * @since 3.1.0
</span><span class="cx">  */
</span><span class="cx"> class WP_Users_List_Table extends WP_List_Table {
</span><ins>+        
+        var $site_id;
+        var $is_site_users;
+        
+        function WP_Users_List_Table() {
+                $screen = get_current_screen();
+                $this-&gt;is_site_users = ( 'site-users-network' == $screen-&gt;id ) ? true : false;
</ins><span class="cx"> 
</span><ins>+                if ( $this-&gt;is_site_users )
+                        $this-&gt;site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+                parent::WP_List_Table( array(
+                        'singular' =&gt; 'user',
+                        'plural'   =&gt; 'users'
+                ) );
+        }
+
</ins><span class="cx">         function check_permissions() {
</span><span class="cx">                 if ( !current_user_can('list_users') )
</span><span class="cx">                         wp_die(__('Cheatin&amp;#8217; uh?'));
</span><ins>+
+                if ( $this-&gt;is_site_users &amp;&amp; !current_user_can('manage_sites') )
+                        wp_die(__('You do not have sufficient permissions to edit this site.'));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function prepare_items() {
</span><span class="lines">@@ -30,6 +49,9 @@
</span><span class="cx">                         'role' =&gt; $role,
</span><span class="cx">                         'search' =&gt; $usersearch
</span><span class="cx">                 );
</span><ins>+                
+                if ( $this-&gt;is_site_users )
+                        $args['blog_id'] = $this-&gt;site_id;
</ins><span class="cx"> 
</span><span class="cx">                 if ( isset( $_REQUEST['orderby'] ) )
</span><span class="cx">                         $args['orderby'] = $_REQUEST['orderby'];
</span><span class="lines">@@ -55,7 +77,15 @@
</span><span class="cx">         function get_views() {
</span><span class="cx">                 global $wp_roles, $role;
</span><span class="cx"> 
</span><del>-                $users_of_blog = count_users();
</del><ins>+                if ( $this-&gt;is_site_users ) {
+                        $url = 'site-users.php?id=' . $this-&gt;site_id;                        
+                        switch_to_blog( $this-&gt;site_id );
+                        $users_of_blog = count_users();
+                        restore_current_blog();
+                } else {
+                        $url = 'users.php';
+                        $users_of_blog = count_users();
+                }
</ins><span class="cx">                 $total_users = $users_of_blog['total_users'];
</span><span class="cx">                 $avail_roles =&amp; $users_of_blog['avail_roles'];
</span><span class="cx">                 unset($users_of_blog);
</span><span class="lines">@@ -63,7 +93,7 @@
</span><span class="cx">                 $current_role = false;
</span><span class="cx">                 $class = empty($role) ? ' class=&quot;current&quot;' : '';
</span><span class="cx">                 $role_links = array();
</span><del>-                $role_links['all'] = &quot;&lt;a href='users.php'$class&gt;&quot; . sprintf( _nx( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '&lt;/a&gt;';
</del><ins>+                $role_links['all'] = &quot;&lt;a href='$url'$class&gt;&quot; . sprintf( _nx( 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', 'All &lt;span class=&quot;count&quot;&gt;(%s)&lt;/span&gt;', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '&lt;/a&gt;';
</ins><span class="cx">                 foreach ( $wp_roles-&gt;get_names() as $this_role =&gt; $name ) {
</span><span class="cx">                         if ( !isset($avail_roles[$this_role]) )
</span><span class="cx">                                 continue;
</span><span class="lines">@@ -78,7 +108,7 @@
</span><span class="cx">                         $name = translate_user_role( $name );
</span><span class="cx">                         /* translators: User role name with count */
</span><span class="cx">                         $name = sprintf( __('%1$s &lt;span class=&quot;count&quot;&gt;(%2$s)&lt;/span&gt;'), $name, $avail_roles[$this_role] );
</span><del>-                        $role_links[$this_role] = &quot;&lt;a href='users.php?role=$this_role'$class&gt;$name&lt;/a&gt;&quot;;
</del><ins>+                        $role_links[$this_role] = &quot;&lt;a href='&quot; . add_query_arg( 'role', $this_role, $url ) . &quot;'$class&gt;$name&lt;/a&gt;&quot;;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 return $role_links;
</span><span class="lines">@@ -171,6 +201,11 @@
</span><span class="cx">                         $user_object = new WP_User( (int) $user_object );
</span><span class="cx">                 $user_object = sanitize_user_object( $user_object, 'display' );
</span><span class="cx">                 $email = $user_object-&gt;user_email;
</span><ins>+                
+                if ( $this-&gt;is_site_users )
+                        $url = &quot;site-users.php?id={$this-&gt;site_id}&amp;amp;&quot;;
+                else
+                        $url = 'users.php?';
</ins><span class="cx"> 
</span><span class="cx">                 $checkbox = '';
</span><span class="cx">                 // Check if the user for this row is editable
</span><span class="lines">@@ -197,7 +232,7 @@
</span><span class="cx">                         if ( !is_multisite() &amp;&amp; get_current_user_id() != $user_object-&gt;ID &amp;&amp; current_user_can( 'delete_user', $user_object-&gt;ID ) )
</span><span class="cx">                                 $actions['delete'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url( &quot;users.php?action=delete&amp;amp;user=$user_object-&gt;ID&quot;, 'bulk-users' ) . &quot;'&gt;&quot; . __( 'Delete' ) . &quot;&lt;/a&gt;&quot;;
</span><span class="cx">                         if ( is_multisite() &amp;&amp; get_current_user_id() != $user_object-&gt;ID &amp;&amp; current_user_can( 'remove_user', $user_object-&gt;ID ) )
</span><del>-                                $actions['remove'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url( &quot;users.php?action=remove&amp;amp;user=$user_object-&gt;ID&quot;, 'bulk-users' ) . &quot;'&gt;&quot; . __( 'Remove' ) . &quot;&lt;/a&gt;&quot;;
</del><ins>+                                $actions['remove'] = &quot;&lt;a class='submitdelete' href='&quot; . wp_nonce_url( $url.&quot;action=remove&amp;amp;user=$user_object-&gt;ID&quot;, 'bulk-users' ) . &quot;'&gt;&quot; . __( 'Remove' ) . &quot;&lt;/a&gt;&quot;;
</ins><span class="cx">                         $actions = apply_filters( 'user_row_actions', $actions, $user_object );
</span><span class="cx">                         $edit .= $this-&gt;row_actions( $actions );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminnetworksiteusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/site-users.php (16559 => 16560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/site-users.php        2010-11-24 00:27:54 UTC (rev 16559)
+++ trunk/wp-admin/network/site-users.php        2010-11-24 05:31:25 UTC (rev 16560)
</span><span class="lines">@@ -16,6 +16,17 @@
</span><span class="cx"> if ( ! current_user_can('manage_sites') )
</span><span class="cx">         wp_die(__('You do not have sufficient permissions to edit this site.'));
</span><span class="cx"> 
</span><ins>+$wp_list_table = get_list_table('WP_Users_List_Table');
+$wp_list_table-&gt;check_permissions();
+$wp_list_table-&gt;prepare_items();
+
+$action = $wp_list_table-&gt;current_action();
+
+$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
+
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+$_SERVER['REQUEST_URI'] = remove_query_arg(array('enable', 'disable', 'enable-selected', 'disable-selected'), $_SERVER['REQUEST_URI']);
+
</ins><span class="cx"> $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
</span><span class="cx"> 
</span><span class="cx"> if ( ! $id )
</span><span class="lines">@@ -38,74 +49,65 @@
</span><span class="cx">         $editblog_roles = $wp_roles-&gt;roles;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset($_REQUEST['action']) &amp;&amp; 'update-site' == $_REQUEST['action'] ) {
-        check_admin_referer( 'edit-site' );
</del><ins>+$action = $wp_list_table-&gt;current_action();
</ins><span class="cx"> 
</span><ins>+if ( $action ) {
</ins><span class="cx">         switch_to_blog( $id );
</span><ins>+        
+        switch ( $action ) {
+                case 'adduser':
+                        if ( !empty( $_POST['newuser'] ) ) {
+                                $newuser = $_POST['newuser'];
+                                $userid = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT ID FROM &quot; . $wpdb-&gt;users . &quot; WHERE user_login = %s&quot;, $newuser ) );
+                                if ( $userid ) {
+                                        $user = $wpdb-&gt;get_var( &quot;SELECT user_id FROM &quot; . $wpdb-&gt;usermeta . &quot; WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'&quot; );
+                                        if ( $user == false )
+                                                add_user_to_blog( $id, $userid, $_POST['new_role'] );
+                                }
+                        }
+                        break;
+                
+                case 'remove':
+                        if ( !current_user_can('remove_users')  )
+                                die(__('You can&amp;#8217;t remove users.'));
</ins><span class="cx"> 
</span><del>-        // user roles
-        if ( isset( $_POST['role'] ) &amp;&amp; is_array( $_POST['role'] ) == true ) {
-                $newroles = $_POST['role'];
</del><ins>+                        if ( isset( $_REQUEST['users'] ) ) {
+                                $userids = $_REQUEST['users'];
</ins><span class="cx"> 
</span><del>-                reset( $newroles );
-                foreach ( (array) $newroles as $userid =&gt; $role ) {
-                        $user = new WP_User( $userid );
-                        if ( empty( $user-&gt;ID ) )
-                                continue;
-                        $user-&gt;for_blog( $id );
-                        $user-&gt;set_role( $role );
-                }
-        }
</del><ins>+                                foreach ( $userids as $user_id ) {
+                                        $user_id = (int) $user_id;
+                                        remove_user_from_blog( $user_id, $id );
+                                }
+                        } else {
+                                remove_user_from_blog( $_GET['user'] );
+                        }
+                        break;
</ins><span class="cx"> 
</span><del>-        // remove user
-        if ( isset( $_POST['blogusers'] ) &amp;&amp; is_array( $_POST['blogusers'] ) ) {
-                reset( $_POST['blogusers'] );
-                foreach ( (array) $_POST['blogusers'] as $key =&gt; $val )
-                        remove_user_from_blog( $key, $id );
-        }
</del><ins>+                case 'promote':
+                        $editable_roles = get_editable_roles();
+                        if ( empty( $editable_roles[$_REQUEST['new_role']] ) )
+                                wp_die(__('You can&amp;#8217;t give users that role.'));
</ins><span class="cx"> 
</span><del>-        // change password
-        if ( isset( $_POST['user_password'] ) &amp;&amp; is_array( $_POST['user_password'] ) ) {
-                reset( $_POST['user_password'] );
-                $newroles = $_POST['role'];
-                foreach ( (array) $_POST['user_password'] as $userid =&gt; $pass ) {
-                        unset( $_POST['role'] );
-                        $_POST['role'] = $newroles[ $userid ];
-                        if ( $pass != '' ) {
-                                $cap = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT meta_value FROM {$wpdb-&gt;usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'&quot;, $userid ) );
-                                $userdata = get_userdata($userid);
-                                $_POST['pass1'] = $_POST['pass2'] = $pass;
-                                $_POST['email'] = $userdata-&gt;user_email;
-                                $_POST['rich_editing'] = $userdata-&gt;rich_editing;
-                                edit_user( $userid );
-                                if ( $cap == null )
-                                        $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$wpdb-&gt;usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'&quot;, $userid ) );
-                        }
-                }
-                unset( $_POST['role'] );
-                $_POST['role'] = $newroles;
-        }
</del><ins>+                        $userids = $_REQUEST['users'];
+                        $update = 'promote';
+                        foreach ( $userids as $user_id ) {
+                                $user_id = (int) $user_id;
</ins><span class="cx"> 
</span><del>-        // add user
-        if ( !empty( $_POST['newuser'] ) ) {
-                $newuser = $_POST['newuser'];
-                $userid = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT ID FROM &quot; . $wpdb-&gt;users . &quot; WHERE user_login = %s&quot;, $newuser ) );
-                if ( $userid ) {
-                        $user = $wpdb-&gt;get_var( &quot;SELECT user_id FROM &quot; . $wpdb-&gt;usermeta . &quot; WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'&quot; );
-                        if ( $user == false )
-                                add_user_to_blog( $id, $userid, $_POST['new_role'] );
-                }
-        }
</del><ins>+                                // If the user doesn't already belong to the blog, bail.
+                                if ( !is_user_member_of_blog( $user_id ) )
+                                        wp_die(__('Cheatin&amp;#8217; uh?'));
</ins><span class="cx"> 
</span><ins>+                                $user = new WP_User( $user_id );
+                                $user-&gt;set_role( $_REQUEST['new_role'] );
+                        }
+                        break;
+        }
+        
</ins><span class="cx">         restore_current_blog();
</span><del>-        wp_redirect( add_query_arg( array( 'update' =&gt; 'updated', 'id' =&gt; $id ), 'site-users.php') );
</del><ins>+        wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset($_GET['update']) ) {
-        $messages = array();
-        if ( 'updated' == $_GET['update'] )
-                $messages[] = __('Site users updated.');
-}
</del><ins>+add_screen_option( 'per_page', array( 'label' =&gt; _x( 'Users', 'users per page (screen options)' ) ) );
</ins><span class="cx"> 
</span><span class="cx"> $title = sprintf( __('Edit Site: %s'), get_blogaddress_by_id($id));
</span><span class="cx"> $parent_file = 'sites.php';
</span><span class="lines">@@ -128,61 +130,27 @@
</span><span class="cx"> }
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/h3&gt;
</span><del>-&lt;?php
-if ( ! empty( $messages ) ) {
-        foreach ( $messages as $msg )
-                echo '&lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;' . $msg . '&lt;/p&gt;&lt;/div&gt;';
-} ?&gt;
</del><ins>+&lt;form class=&quot;search-form&quot; action=&quot;&quot; method=&quot;get&quot;&gt;
+&lt;p class=&quot;search-box&quot;&gt;
+        &lt;label class=&quot;screen-reader-text&quot; for=&quot;user-search-input&quot;&gt;&lt;?php _e( 'Search Users' ); ?&gt;:&lt;/label&gt;
+        &lt;input type=&quot;text&quot; id=&quot;user-search-input&quot; name=&quot;s&quot; value=&quot;&lt;?php echo esc_attr($usersearch); ?&gt;&quot; /&gt;
+        &lt;?php submit_button( __( 'Search Users' ), 'button', 'submit', false ); ?&gt;
+&lt;/p&gt;
+&lt;/form&gt;
+
+&lt;?php $wp_list_table-&gt;views(); ?&gt;
+
</ins><span class="cx"> &lt;form method=&quot;post&quot; action=&quot;site-users.php?action=update-site&quot;&gt;
</span><span class="cx">         &lt;?php wp_nonce_field( 'edit-site' ); ?&gt;
</span><span class="cx">         &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo esc_attr( $id ) ?&gt;&quot; /&gt;
</span><del>-&lt;?php
-$blogusers = get_users( array( 'blog_id' =&gt; $id, 'number' =&gt; 20 ) );
</del><span class="cx"> 
</span><del>-if ( is_array( $blogusers ) ) {
-        echo '&lt;table class=&quot;form-table&quot;&gt;';
-        echo &quot;&lt;tr&gt;&lt;th&gt;&quot; . __( 'User' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Role' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Password' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Remove' ) . &quot;&lt;/th&gt;&lt;/tr&gt;&quot;;
-        $user_count = 0;
</del><ins>+&lt;?php $wp_list_table-&gt;display(); ?&gt;
</ins><span class="cx"> 
</span><del>-        foreach ( $blogusers as $user_id =&gt; $user_object ) {
-                $user_count++;
-                $existing_role = reset( $user_object-&gt;roles );
-
-                echo '&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;user-edit.php?user_id=' . $user_id . '&quot;&gt;' . $user_object-&gt;user_login . '&lt;/a&gt;&lt;/td&gt;';
-                if ( $user_id != $current_user-&gt;data-&gt;ID ) {
-                        ?&gt;
-                        &lt;td&gt;
-                                &lt;select name=&quot;role[&lt;?php echo $user_id ?&gt;]&quot; id=&quot;new_role_1&quot;&gt;&lt;?php
-                                        foreach ( $editblog_roles as $role =&gt; $role_assoc ){
-                                                $name = translate_user_role( $role_assoc['name'] );
-                                                echo '&lt;option ' . selected( $role, $existing_role, false ) . ' value=&quot;' . esc_attr( $role ) . '&quot;&gt;' . esc_html( $name ) . '&lt;/option&gt;';
-                                        }
-                                        ?&gt;
-                                &lt;/select&gt;
-                        &lt;/td&gt;
-                        &lt;td&gt;
-                                &lt;input type=&quot;text&quot; name=&quot;user_password[&lt;?php echo esc_attr( $user_id ) ?&gt;]&quot; /&gt;
-                        &lt;/td&gt;
-                        &lt;?php
-                        echo '&lt;td&gt;&lt;input title=&quot;' . __( 'Click to remove user' ) . '&quot; type=&quot;checkbox&quot; name=&quot;blogusers[' . esc_attr( $user_id ) . ']&quot; /&gt;&lt;/td&gt;';
-                } else {
-                        echo &quot;&lt;td&gt;&lt;strong&gt;&quot; . __ ( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&quot; . __ ( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&quot; . __( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&quot;;
-                }
-                echo '&lt;/tr&gt;';
-        }
-        echo &quot;&lt;/table&gt;&quot;;
-        submit_button();
-        if ( 20 == $user_count )
-                echo '&lt;p&gt;' . sprintf( __('First 20 users shown. &lt;a href=&quot;%s&quot;&gt;Manage all users&lt;/a&gt;.'), get_admin_url($id, 'users.php') ) . '&lt;/p&gt;';
-} else {
-        _e('This site has no users.');
-}
-?&gt;
</del><span class="cx"> &lt;/form&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;h3 id=&quot;add-new-user&quot;&gt;&lt;?php _e('Add Existing User') ?&gt;&lt;/h3&gt;
</span><span class="cx"> &lt;p class=&quot;description&quot;&gt;&lt;?php _e( 'Enter the username of an existing user.' ) ?&gt;&lt;/p&gt;
</span><del>-        &lt;form action=&quot;site-users.php?action=update-site&quot; id=&quot;adduser&quot; method=&quot;post&quot;&gt;
</del><ins>+        &lt;form action=&quot;site-users.php?action=adduser&quot; id=&quot;adduser&quot; method=&quot;post&quot;&gt;
</ins><span class="cx">         &lt;?php wp_nonce_field( 'edit-site' ); ?&gt;
</span><span class="cx">         &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo esc_attr( $id ) ?&gt;&quot; /&gt;
</span><span class="cx">         &lt;table class=&quot;form-table&quot;&gt;
</span></span></pre>
</div>
</div>

</body>
</html>