Set the type attribute of the buttons for logging out of all sessions to buttons

By not setting this attribute, the buttons default to submit and as the first
submit button on the page, it causes pressing the enter key to log you out of
all sessions. This change restores the pre 4.1 behavior where pressing enter
while focused on a form field submits the form.

merges [31010] to the 4.1 branch

props ocean90

fixes #30871


Built from https://develop.svn.wordpress.org/branches/4.1@31076


git-svn-id: http://core.svn.wordpress.org/branches/4.1@31057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin 2015-01-08 04:42:26 +00:00
parent 7f36f7b28f
commit 9c1e85d376
1 changed files with 3 additions and 3 deletions

View File

@ -489,7 +489,7 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
<tr class="user-sessions-wrap hide-if-no-js">
<th>&nbsp;</th>
<td aria-live="assertive">
<div class="destroy-sessions"><button disabled class="button button-secondary"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div>
<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>
@ -499,7 +499,7 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
<tr class="user-sessions-wrap hide-if-no-js">
<th>&nbsp;</th>
<td aria-live="assertive">
<div class="destroy-sessions"><button class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div>
<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>
@ -509,7 +509,7 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
<tr class="user-sessions-wrap hide-if-no-js">
<th>&nbsp;</th>
<td>
<p><button class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Sessions' ); ?></button></p>
<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. */