mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user