WordPress.org

Make WordPress Core

Changeset 36558


Ignore:
Timestamp:
02/17/2016 07:41:14 PM (5 years ago)
Author:
ocean90
Message:

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

Props adamsilverstein, afercia.
Fixes #35257.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r36297 r36558  
    462462                        if ( $status['url'] ) {
    463463                            /* translators: 1: Plugin name and version */
    464                             $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>';
     464                            $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>';
    465465                        }
    466466
  • trunk/src/wp-admin/js/updates.js

    r36221 r36558  
    525525            var $button = $( e.target );
    526526
     527            // Do nothing while updating and when the button is disabled.
     528            if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
     529                return;
     530            }
     531
    527532            if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.updateLock ) {
    528533                wp.updates.requestFilesystemCredentials( e );
Note: See TracChangeset for help on using the changeset viewer.