Network Admin: Properly pass the number of delete plugins to the corresponding message.

Fixes #33239.

git-svn-id: https://develop.svn.wordpress.org/trunk@34591 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-09-26 13:10:05 +00:00
parent 35837a00b7
commit 411f0f126e

View File

@ -368,11 +368,14 @@ if ( $action ) {
<?php <?php
require_once(ABSPATH . 'wp-admin/admin-footer.php'); require_once(ABSPATH . 'wp-admin/admin-footer.php');
exit; exit;
} //Endif verify-delete } else {
$delete_result = delete_plugins($plugins); $plugins_to_delete = count( $plugins );
} // endif verify-delete
$delete_result = delete_plugins( $plugins );
set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length
wp_redirect( self_admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") ); wp_redirect( self_admin_url("plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s") );
exit; exit;
case 'clear-recent-list': case 'clear-recent-list':
@ -470,7 +473,7 @@ if ( ! empty( $invalid ) ) {
<div id="message" class="updated notice is-dismissible"> <div id="message" class="updated notice is-dismissible">
<p> <p>
<?php <?php
if ( 1 == $plugins_to_delete ) { if ( 1 == (int) $_GET['deleted'] ) {
_e( 'The selected plugin has been <strong>deleted</strong>.' ); _e( 'The selected plugin has been <strong>deleted</strong>.' );
} else { } else {
_e( 'The selected plugins have been <strong>deleted</strong>.' ); _e( 'The selected plugins have been <strong>deleted</strong>.' );