Make WordPress Core

Changeset 50151


Ignore:
Timestamp:
02/02/2021 05:29:27 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Introduce a filter for the result of WP_Upgrader::install_package().

This allows for the capture and usage of error data from the method, to facilitate a potential plugin/theme rollback in the event of an update failure.

Props afragen, dd32.
Fixes #52381.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r49946 r50151  
    798798            )
    799799        );
     800
     801        /**
     802         * Filters the result of WP_Upgrader::install_package().
     803         *
     804         * @since 5.7.0
     805         *
     806         * @param array|WP_Error $result     Result from WP_Upgrader::install_package().
     807         * @param array          $hook_extra Extra arguments passed to hooked filters.
     808         */
     809        $result = apply_filters( 'upgrader_install_package_result', $result, $options['hook_extra'] );
    800810
    801811        $this->skin->set_result( $result );
Note: See TracChangeset for help on using the changeset viewer.