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

Props adamsilverstein, afercia.
Fixes #35257.

git-svn-id: https://develop.svn.wordpress.org/trunk@36558 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2016-02-17 19:41:14 +00:00
parent 8445b1b48d
commit 1d19617606
2 changed files with 6 additions and 1 deletions
@@ -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;
+5
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 );
}