+ </label></th>
+ <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($profileuser->$name) ?>" class="regular-text" /></td>
+</tr>
+<?php
+ }
+?>
+</table>
+
+<h2><?php IS_PROFILE_PAGE ? _e( 'About Yourself' ) : _e( 'About the user' ); ?></h2>
+
+<table class="form-table">
+<tr class="user-description-wrap">
+ <th><label for="description"><?php _e('Biographical Info'); ?></label></th>
+ <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea>
+ <p class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p></td>
+</tr>
+
+<?php if ( get_option( 'show_avatars' ) ) : ?>
+<tr class="user-profile-picture">
+ <th><?php _e( 'Profile Picture' ); ?></th>
+ <td>
+ <?php echo get_avatar( $user_id ); ?>
+ <p class="description"><?php
+ if ( IS_PROFILE_PAGE ) {
+ /* translators: %s: Gravatar URL */
+ $description = sprintf( __( 'You can change your profile picture on <a href="%s">Gravatar</a>.' ),
+ __( 'https://en.gravatar.com/' )
+ );
+ } else {
+ $description = '';
+ }
+
+ /**
+ * Filter the user profile picture description displayed under the Gravatar.
+ *
+ * @since 4.4.0
+ *
+ * @param string $description The description that will be printed.
+ */
+ echo apply_filters( 'user_profile_picture_description', $description );
+ ?></p>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+/**
+ * Filter the display of the password fields.
+ *
+ * @since 1.5.1
+ * @since 2.8.0 Added the `$profileuser` parameter.
+ * @since 4.4.0 Now evaluated only in user-edit.php.
+ *
+ * @param bool $show Whether to show the password fields. Default true.
+ * @param WP_User $profileuser User object for the current user to edit.
+ */
+if ( $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ) ) :
+?>
+</table>
+
+<h2><?php _e( 'Account Management' ); ?></h2>
+<table class="form-table">
+<tr id="password" class="user-pass1-wrap">
+ <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th>
+ <td>
+ <input class="hidden" value=" " /><!-- #24364 workaround -->
+ <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button>
+ <div class="wp-pwd hide-if-js">
+ <span class="password-input-wrapper">
+ <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
+ </span>
+ <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
+ <span class="dashicons dashicons-hidden"></span>
+ <span class="text"><?php _e( 'Hide' ); ?></span>
+ </button>
+ <button type="button" class="button button-secondary wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
+ <span class="text"><?php _e( 'Cancel' ); ?></span>
+ </button>
+ <div style="display:none" id="pass-strength-result" aria-live="polite"></div>
+ </div>
+ </td>
+</tr>
+<tr class="user-pass2-wrap hide-if-js">
+ <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
+ <td>
+ <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" />
+ <p class="description"><?php _e( 'Type your new password again.' ); ?></p>
+ </td>
+</tr>
+<tr class="pw-weak">
+ <th><?php _e( 'Confirm Password' ); ?></th>
+ <td>
+ <label>
+ <input type="checkbox" name="pw_weak" class="pw-checkbox" />
+ <?php _e( 'Confirm use of weak password' ); ?>
+ </label>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th><?php _e( 'Sessions' ); ?></th>
+ <td aria-live="assertive">
+ <div class="destroy-sessions"><button type="button" disabled class="button button-secondary"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
+ <p class="description">
+ <?php _e( 'You are only logged in at this location.' ); ?>
+ </p>
+ </td>
+ </tr>
+<?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th><?php _e( 'Sessions' ); ?></th>
+ <td aria-live="assertive">
+ <div class="destroy-sessions"><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
+ <p class="description">
+ <?php _e( 'Did you lose your phone or leave your account logged in at a public computer? You can log out everywhere else, and stay logged in here.' ); ?>
+ </p>
+ </td>
+ </tr>
+<?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th><?php _e( 'Sessions' ); ?></th>
+ <td>
+ <p><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out Everywhere' ); ?></button></p>
+ <p class="description">
+ <?php
+ /* translators: 1: User's display name. */
+ printf( __( 'Log %s out of all locations.' ), $profileuser->display_name );
+ ?>
+ </p>
+ </td>
+ </tr>
+<?php endif; ?>
+
+</table>
+
+<?php
+ if ( IS_PROFILE_PAGE ) {
+ /**
+ * Fires after the 'About Yourself' settings table on the 'Your Profile' editing screen.
+ *
+ * The action only fires if the current user is editing their own profile.
+ *
+ * @since 2.0.0
+ *
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ do_action( 'show_user_profile', $profileuser );
+ } else {
+ /**
+ * Fires after the 'About the User' settings table on the 'Edit User' screen.
+ *
+ * @since 2.0.0
+ *
+ * @param WP_User $profileuser The current WP_User object.
+ */
+ do_action( 'edit_user_profile', $profileuser );
+ }
+?>
+
+<?php
+/**
+ * Filter whether to display additional capabilities for the user.
+ *
+ * The 'Additional Capabilities' section will only be enabled if
+ * the number of the user's capabilities exceeds their number of
+ * roles.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $enable Whether to display the capabilities. Default true.
+ * @param WP_User $profileuser The current WP_User object.
+ */
+if ( count( $profileuser->caps ) > count( $profileuser->roles )
+ && apply_filters( 'additional_capabilities_display', true, $profileuser )
+) : ?>
+<h2><?php _e( 'Additional Capabilities' ); ?></h2>
+<table class="form-table">
+<tr class="user-capabilities-wrap">
+ <th scope="row"><?php _e( 'Capabilities' ); ?></th>
+ <td>
+<?php
+ $output = '';
+ foreach ( $profileuser->caps as $cap => $value ) {
+ if ( ! $wp_roles->is_role( $cap ) ) {
+ if ( '' != $output )
+ $output .= ', ';
+ $output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
+ }
+ }
+ echo $output;
+?>
+ </td>
+</tr>
+</table>
+<?php endif; ?>
+
+<input type="hidden" name="action" value="update" />
+<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />
+
+<?php submit_button( IS_PROFILE_PAGE ? __('Update Profile') : __('Update User') ); ?>
+