Updates: Prevent further actions if an update button is disabled.

Props adamsilverstein, afercia.
Fixes #35257.
Built from https://develop.svn.wordpress.org/trunk@36558


git-svn-id: http://core.svn.wordpress.org/trunk@36525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-02-17 19:42:26 +00:00
parent d1d90a3263
commit 8b781dfaa7
4 changed files with 8 additions and 3 deletions

View File

@ -461,7 +461,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
case 'update_available':
if ( $status['url'] ) {
/* translators: 1: Plugin name and version */
$action_links[] = '<a class="update-now button" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Update Now' ) . '</a>';
$action_links[] = '<a class="update-now button aria-button-if-js" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Update Now' ) . '</a>';
}
break;

View File

@ -524,6 +524,11 @@ window.wp = window.wp || {};
e.preventDefault();
var $button = $( e.target );
// Do nothing while updating and when the button is disabled.
if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
return;
}
if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.updateLock ) {
wp.updates.requestFilesystemCredentials( e );
}

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36557';
$wp_version = '4.5-alpha-36558';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.