Make WordPress Core

Ticket #61381: 61381.diff

File 61381.diff, 1.2 KB (added by siliconforks, 9 months ago)

This patch is very similar to r57615.

  • src/js/_enqueues/wp/updates.js

     
    619619         */
    620620        wp.updates.updatePluginError = function( response ) {
    621621                var $pluginRow, $card, $message, errorMessage, buttonText, ariaLabel,
    622                         $adminBarUpdates = $( '#wp-admin-bar-updates' );
     622                        $adminBarUpdates = $( '#wp-admin-bar-updates' ),
     623                        isPluginInstall = 'plugin-install' === pagenow || 'plugin-install-network' === pagenow;
    623624
    624625                if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
    625626                        return;
     
    658659                        } else {
    659660                                $message.find( 'p' ).removeAttr( 'aria-label' );
    660661                        }
    661                 } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
     662                } else if ( isPluginInstall ) {
    662663                        buttonText = __( 'Update failed.' );
    663664
    664665                        $card = $( '.plugin-card-' + response.slug + ', #plugin-information-footer' )
     
    707708
    708709                wp.a11y.speak( errorMessage, 'assertive' );
    709710
    710                 if ( 'plugin-information-footer' === $card.attr('id' ) ) {
     711                if ( isPluginInstall && 'plugin-information-footer' === $card.attr( 'id' ) ) {
    711712                        wp.updates.setCardButtonStatus(
    712713                                {
    713714                                        status: 'plugin-update-failed',