Skip to content

Commit b57fbe9

Browse files
committed
refresh 38112.2.diff
1 parent dcf780a commit b57fbe9

File tree

2 files changed

+65
-4
lines changed

2 files changed

+65
-4
lines changed

src/js/_enqueues/wp/updates.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,10 +1496,10 @@
14961496
} );
14971497

14981498
if ( response.plugin ) {
1499-
$plugin = $( 'tr.inactive[data-plugin="' + response.plugin + '"]' );
1499+
$plugin = $( 'tr[data-plugin="' + response.plugin + '"]' );
15001500
$pluginUpdateRow = $plugin.siblings( '[data-plugin="' + response.plugin + '"]' );
15011501
} else {
1502-
$plugin = $( 'tr.inactive[data-slug="' + response.slug + '"]' );
1502+
$plugin = $( 'tr[data-slug="' + response.slug + '"]' );
15031503
$pluginUpdateRow = $plugin.siblings( '[data-slug="' + response.slug + '"]' );
15041504
}
15051505

@@ -2898,7 +2898,7 @@
28982898
} );
28992899

29002900
// Display bulk notification for updates of any kind.
2901-
$document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) {
2901+
$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 ) {
29022902
var $itemRow = $( '[data-slug="' + response.slug + '"]' ),
29032903
$bulkActionNotice, itemName;
29042904

@@ -2913,7 +2913,11 @@
29132913

29142914
$itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false );
29152915

2916-
wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
2916+
if ( -1 !== event.type.indexOf( '-update-' ) ) {
2917+
wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' );
2918+
} else {
2919+
wp.updates.adminNotice = wp.template( 'wp-bulk-deletions-admin-notice' );
2920+
}
29172921

29182922
var successMessage = null;
29192923

src/wp-admin/includes/update.php

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,63 @@ function wp_print_admin_notice_templates() {
946946
<# } #>
947947
</div>
948948
</script>
949+
<script id="tmpl-wp-bulk-deletions-admin-notice" type="text/html">
950+
<div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
951+
<p>
952+
<# if ( data.successes ) { #>
953+
<# if ( 1 === data.successes ) { #>
954+
<# if ( 'plugin' === data.type ) { #>
955+
<?php
956+
/* translators: %s: Number of plugins */
957+
printf( __( '%s plugin successfully deleted.' ), '{{ data.successes }}' );
958+
?>
959+
<# } else { #>
960+
<?php
961+
/* translators: %s: Number of themes */
962+
printf( __( '%s theme successfully deleted.' ), '{{ data.successes }}' );
963+
?>
964+
<# } #>
965+
<# } else { #>
966+
<# if ( 'plugin' === data.type ) { #>
967+
<?php
968+
/* translators: %s: Number of plugins */
969+
printf( __( '%s plugins successfully deleted.' ), '{{ data.successes }}' );
970+
?>
971+
<# } else { #>
972+
<?php
973+
/* translators: %s: Number of themes */
974+
printf( __( '%s themes successfully deleted.' ), '{{ data.successes }}' );
975+
?>
976+
<# } #>
977+
<# } #>
978+
<# } #>
979+
<# if ( data.errors ) { #>
980+
<button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
981+
<# if ( 1 === data.errors ) { #>
982+
<?php
983+
/* translators: %s: Number of failed updates */
984+
printf( __( '%s deletion failed.' ), '{{ data.errors }}' );
985+
?>
986+
<# } else { #>
987+
<?php
988+
/* translators: %s: Number of failed updates */
989+
printf( __( '%s deletions failed.' ), '{{ data.errors }}' );
990+
?>
991+
<# } #>
992+
<span class="screen-reader-text"><?php _e( 'Show more details' ); ?></span>
993+
<span class="toggle-indicator" aria-hidden="true"></span>
994+
</button>
995+
<# } #>
996+
</p>
997+
<# if ( data.errors ) { #>
998+
<ul class="bulk-action-errors hidden">
999+
<# _.each( data.errorMessages, function( errorMessage ) { #>
1000+
<li>{{ errorMessage }}</li>
1001+
<# } ); #>
1002+
</ul>
1003+
<# } #>
1004+
</div>
1005+
</script>
9491006
<?php
9501007
}
9511008

0 commit comments

Comments
 (0)