+<?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>