Upgrade/Install: Store correct result when bulk updating plugins or themes.

This ensures that when multiple plugins or themes are updated and one succeeds and another fails, the error is reported accordingly.

Previously, both updates would end up treated as a success, due to `$this->result` containing the result of the previous operation and not the current one.

Follow-up to [12097].

Props pwtyler, afragen.
Fixes #53002.

git-svn-id: https://develop.svn.wordpress.org/trunk@51528 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-08-02 20:54:44 +00:00
parent 80ccb3697c
commit 717158ee32
2 changed files with 2 additions and 2 deletions

View File

@@ -347,7 +347,7 @@ class Plugin_Upgrader extends WP_Upgrader {
)
);
$results[ $plugin ] = $this->result;
$results[ $plugin ] = $result;
// Prevent credentials auth screen from displaying multiple times.
if ( false === $result ) {

View File

@@ -448,7 +448,7 @@ class Theme_Upgrader extends WP_Upgrader {
)
);
$results[ $theme ] = $this->result;
$results[ $theme ] = $result;
// Prevent credentials auth screen from displaying multiple times.
if ( false === $result ) {