Make WordPress Core

Ticket #37512: trigger-update-delete-and-install5.diff

File trigger-update-delete-and-install5.diff, 2.1 KB (added by DavidAnderson, 8 years ago)

V5: Adjust to reflect fact that the bulk action handler can be invoked for themes as well as plugins

  • wp-admin/js/updates.js

     
    369369                        .attr( 'aria-label', message )
    370370                        .text( wp.updates.l10n.updating );
    371371
    372                 $document.trigger( 'wp-plugin-updating' );
     372                $document.trigger( 'wp-plugin-updating', args );
    373373
    374374                return wp.updates.ajax( 'update-plugin', args );
    375375        };
     
    525525                // Remove previous error messages, if any.
    526526                $card.removeClass( 'plugin-card-install-failed' ).find( '.notice.notice-error' ).remove();
    527527
     528                $document.trigger( 'wp-plugin-installing', args );
     529               
    528530                return wp.updates.ajax( 'install-plugin', args );
    529531        };
    530532
     
    715717
    716718                wp.a11y.speak( wp.updates.l10n.deleting, 'polite' );
    717719
     720                $document.trigger( 'wp-plugin-deleting', args );
     721               
    718722                return wp.updates.ajax( 'delete-plugin', args );
    719723        };
    720724
     
    905909                wp.a11y.speak( wp.updates.l10n.updatingMsg, 'polite' );
    906910                $notice.text( wp.updates.l10n.updating );
    907911
    908                 $document.trigger( 'wp-theme-updating' );
     912                $document.trigger( 'wp-theme-updating', args );
    909913
    910914                return wp.updates.ajax( 'update-theme', args );
    911915        };
     
    10381042                // Remove previous error messages, if any.
    10391043                $( '.install-theme-info, [data-slug="' + args.slug + '"]' ).removeClass( 'theme-install-failed' ).find( '.notice.notice-error' ).remove();
    10401044
     1045                $document.trigger( 'wp-theme-installing', args );
     1046               
    10411047                return wp.updates.ajax( 'install-theme', args );
    10421048        };
    10431049
     
    11671173                // Remove previous error messages, if any.
    11681174                $( '.theme-info .update-message' ).remove();
    11691175
     1176                $document.trigger( 'wp-theme-deleting', args );
     1177               
    11701178                return wp.updates.ajax( 'delete-theme', args );
    11711179        };
    11721180
     
    19731981                        // Un-check the bulk checkboxes.
    19741982                        $bulkActionForm.find( '.manage-column [type="checkbox"]' ).prop( 'checked', false );
    19751983
     1984                        $document.trigger( 'wp-' + type + '-bulk-' + bulkAction, itemsSelected );
     1985                       
    19761986                        // Find all the checkboxes which have been checked.
    19771987                        itemsSelected.each( function( index, element ) {
    19781988                                var $checkbox  = $( element ),