Ticket #38112: 38112.2.diff
File 38112.2.diff, 4.0 KB (added by , 7 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() { 690 690 <# } #> 691 691 </div> 692 692 </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> 693 750 <?php 694 751 } 695 752 -
src/wp-admin/js/updates.js
diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js index 200241b..99d7860 100644
848 848 } ); 849 849 850 850 if ( response.plugin ) { 851 $plugin = $( 'tr .inactive[data-plugin="' + response.plugin + '"]' );851 $plugin = $( 'tr[data-plugin="' + response.plugin + '"]' ); 852 852 $pluginUpdateRow = $plugin.siblings( '[data-plugin="' + response.plugin + '"]' ); 853 853 } else { 854 $plugin = $( 'tr .inactive[data-slug="' + response.slug + '"]' );854 $plugin = $( 'tr[data-slug="' + response.slug + '"]' ); 855 855 $pluginUpdateRow = $plugin.siblings( '[data-slug="' + response.slug + '"]' ); 856 856 } 857 857 … … 2052 2052 } ); 2053 2053 2054 2054 // Display bulk notification for updates of any kind. 2055 $document.on( 'wp-plugin-update-success wp-plugin-update-error wp- theme-update-success wp-theme-update-error', function( event, response ) {2055 $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 ) { 2056 2056 var $itemRow = $( '[data-slug="' + response.slug + '"]' ), 2057 2057 $bulkActionNotice, itemName; 2058 2058 … … 2067 2067 2068 2068 $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false ); 2069 2069 2070 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' ); 2070 if ( -1 !== event.type.indexOf( '-update-' ) ) { 2071 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' ); 2072 } else { 2073 wp.updates.adminNotice = wp.template( 'wp-bulk-deletions-admin-notice' ); 2074 } 2071 2075 2072 2076 wp.updates.addAdminNotice( { 2073 2077 id: 'bulk-action-notice',