-<?php do_action('edit_user_profile'); ?>
-
-<br clear="all" />
- <table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
- <?php
- if(count($profileuser->caps) > count($profileuser->roles)):
- ?>
- <tr>
- <th scope="row"><?php _e('Additional Capabilities:') ?></th>
- <td><?php
- $output = '';
- foreach($profileuser->caps as $cap => $value) {
- if(!$wp_roles->is_role($cap)) {
- if($output != '') $output .= ', ';
- $output .= $value ? $cap : "Denied: {$cap}";
- }
- }
- echo $output;
- ?></td>
- </tr>
- <?php
- endif;
- ?>
- </table>
-<p class="submit">
- <input type="hidden" name="action" value="update" />
- <input type="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" />
- <input type="submit" value="<?php _e('Update User »') ?>" name="submit" />
- </p>
+<?php
+if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th> </th>
+ <td aria-live="assertive">
+ <div class="destroy-sessions"><button type="button" disabled class="button button-secondary"><?php _e( 'Log Out of All Other Sessions' ); ?></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> </th>
+ <td aria-live="assertive">
+ <div class="destroy-sessions"><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div>
+ <p class="description">
+ <?php _e( 'Left your account logged in at a public computer? Lost your phone? This will log you out everywhere except your current browser.' ); ?>
+ </p>
+ </td>
+ </tr>
+<?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?>
+ <tr class="user-sessions-wrap hide-if-no-js">
+ <th> </th>
+ <td>
+ <p><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Sessions' ); ?></button></p>
+ <p class="description">
+ <?php
+ /* translators: 1: User's display name. */
+ printf( __( 'Log %s out of all sessions' ), $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
+ * 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 )
+) : ?>
+<h3><?php _e( 'Additional Capabilities' ); ?></h3>
+<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') ); ?>
+