Make WordPress Core

Ticket #38112: 38112.diff

File 38112.diff, 3.4 KB (added by swissspidy, 8 years ago)
  • src/wp-admin/includes/update.php

    diff --git src/wp-admin/includes/update.php src/wp-admin/includes/update.php
    index 74899e3..6817f31 100644
    function wp_print_admin_notice_templates() { 
    690690                        <# } #>
    691691                </div>
    692692        </script>
     693        <script id="tmpl-wp-bulk-deletions-admin-notice" type="text/html">
     694                <div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
     695                        <p>
     696                                <# if ( data.successes ) { #>
     697                                        <# if ( 1 === data.successes ) { #>
     698                                                <# if ( 'plugin' === data.type ) { #>
     699                                                        <?php
     700                                                        /* translators: %s: Number of plugins */
     701                                                        printf( __( '%s plugin successfully deleted.' ), '{{ data.successes }}' );
     702                                                        ?>
     703                                                <# } else { #>
     704                                                        <?php
     705                                                        /* translators: %s: Number of themes */
     706                                                        printf( __( '%s theme successfully deleted.' ), '{{ data.successes }}' );
     707                                                        ?>
     708                                                <# } #>
     709                                        <# } else { #>
     710                                                <# if ( 'plugin' === data.type ) { #>
     711                                                        <?php
     712                                                        /* translators: %s: Number of plugins */
     713                                                        printf( __( '%s plugins successfully deleted.' ), '{{ data.successes }}' );
     714                                                        ?>
     715                                                <# } else { #>
     716                                                        <?php
     717                                                        /* translators: %s: Number of themes */
     718                                                        printf( __( '%s themes successfully deleted.' ), '{{ data.successes }}' );
     719                                                        ?>
     720                                                <# } #>
     721                                        <# } #>
     722                                <# } #>
     723                                <# if ( data.errors ) { #>
     724                                        <button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
     725                                                <# if ( 1 === data.errors ) { #>
     726                                                        <?php
     727                                                        /* translators: %s: Number of failed updates */
     728                                                        printf( __( '%s deletion failed.' ), '{{ data.errors }}' );
     729                                                        ?>
     730                                                <# } else { #>
     731                                                        <?php
     732                                                        /* translators: %s: Number of failed updates */
     733                                                        printf( __( '%s deletions failed.' ), '{{ data.errors }}' );
     734                                                        ?>
     735                                                <# } #>
     736                                                <span class="screen-reader-text"><?php _e( 'Show more details' ); ?></span>
     737                                                <span class="toggle-indicator" aria-hidden="true"></span>
     738                                        </button>
     739                                <# } #>
     740                        </p>
     741                        <# if ( data.errors ) { #>
     742                                <ul class="bulk-action-errors hidden">
     743                                        <# _.each( data.errorMessages, function( errorMessage ) { #>
     744                                                <li>{{ errorMessage }}</li>
     745                                        <# } ); #>
     746                                </ul>
     747                        <# } #>
     748                </div>
     749        </script>
    693750        <?php
    694751}
    695752
  • src/wp-admin/js/updates.js

    diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js
    index 239829f..281cb9b 100644
     
    20512051                        } );
    20522052
    20532053                        // Display bulk notification for updates of any kind.
    2054                         $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) {
     2054                        $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-plugin-delete-error wp-theme-update-success wp-theme-update-error wp-theme-delete-error', function( event, response ) {
    20552055                                var $itemRow = $( '[data-slug="' + response.slug + '"]' ),
    20562056                                        $bulkActionNotice, itemName;
    20572057
     
    20662066
    20672067                                $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false );
    20682068
    2069                                 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
     2069                                if ( -1 !== event.type.indexOf( '-update-' ) ) {
     2070                                        wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
     2071                                } else {
     2072                                        wp.updates.adminNotice = wp.template( 'wp-bulk-deletions-admin-notice' );
     2073                                }
    20702074
    20712075                                wp.updates.addAdminNotice( {
    20722076                                        id:            'bulk-action-notice',