+ $avatar = get_avatar( $user->user_email, 32 );
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
+
+ echo $avatar;
+
+ ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo $user->user_login; ?></a><?php
+ if ( in_array( $user->user_login, $super_admins ) ) {
+ echo ' - ' . __( 'Super Admin' );
+ }
+ ?></strong>
+ <?php
+ }
+
+ /**
+ * Handles the name column output.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_name( $user ) {
+ echo "$user->first_name $user->last_name";
+ }
+
+ /**
+ * Handles the email column output.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_email( $user ) {
+ echo "<a href='" . esc_url( "mailto:$user->user_email" ) . "'>$user->user_email</a>";
+ }
+
+ /**
+ * Handles the registered date column output.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @global string $mode
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_registered( $user ) {
+ global $mode;
+ if ( 'list' == $mode ) {
+ $date = __( 'Y/m/d' );
+ } else {
+ $date = __( 'Y/m/d g:i:s a' );
+ }
+ echo mysql2date( $date, $user->user_registered );
+ }
+
+ /**
+ * @since 4.3.0
+ * @access protected
+ *
+ * @param WP_User $user
+ * @param string $classes
+ * @param string $data
+ * @param string $primary
+ */
+ protected function _column_blogs( $user, $classes, $data, $primary ) {
+ echo '<td class="', $classes, ' has-row-actions" ', $data, '>';
+ echo $this->column_blogs( $user );
+ echo $this->handle_row_actions( $user, 'blogs', $primary );
+ echo '</td>';
+ }
+
+ /**
+ * Handles the blogs/sites column output.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @param WP_User $user The current WP_User object.
+ */
+ public function column_blogs( $user ) {
+ $blogs = get_blogs_of_user( $user->ID, true );
+ if ( ! is_array( $blogs ) ) {
+ return;
+ }
+
+ foreach ( $blogs as $val ) {
+ if ( ! can_edit_network( $val->site_id ) ) {
+ continue;
+ }
+
+ $path = ( $val->path == '/' ) ? '' : $val->path;
+ echo '<span class="site-' . $val->site_id . '" >';
+ echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . '</a>';
+ echo ' <small class="row-actions">';
+ $actions = array();
+ $actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>';
+
+ $class = '';
+ if ( $val->spam == 1 ) {
+ $class .= 'site-spammed ';
+ }
+ if ( $val->mature == 1 ) {
+ $class .= 'site-mature ';
+ }
+ if ( $val->deleted == 1 ) {
+ $class .= 'site-deleted ';
+ }
+ if ( $val->archived == 1 ) {
+ $class .= 'site-archived ';
+ }
+
+ $actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
+
+ /**
+ * Filter the action links displayed next the sites a user belongs to
+ * in the Network Admin Users list table.
+ *
+ * @since 3.1.0
+ *
+ * @param array $actions An array of action links to be displayed.
+ * Default 'Edit', 'View'.
+ * @param int $userblog_id The site ID.
+ */
+ $actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id );
+
+ $i=0;
+ $action_count = count( $actions );
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ $sep = ( $i == $action_count ) ? '' : ' | ';
+ echo "<span class='$action'>$link$sep</span>";
+ }
+ echo '</small></span><br/>';
+ }
+ }
+
+ /**
+ * Handles the default column output.
+ *
+ * @since 4.3.0
+ * @access public
+ *
+ * @param WP_User $user The current WP_User object.
+ * @param string $column_name The current column name.
+ */
+ public function column_default( $user, $column_name ) {
+ /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
+ echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
+ }
+
+ public function display_rows() {