Turns off maintenance mode after upgrading an active plugin.
Description
Hooked to the ‘upgrader_post_install’ filter by Plugin_Upgrader::upgrade().
Parameters
$response
bool|WP_Errorrequired- The installation response after the installation has finished.
$plugin
arrayrequired- Plugin package arguments.
Source
public function active_after( $response, $plugin ) {
if ( is_wp_error( $response ) ) {
return $response;
}
// Only disable maintenance mode when in cron (background update).
if ( ! wp_doing_cron() ) {
return $response;
}
$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';
// Only run if plugin is active.
if ( ! is_plugin_active( $plugin ) ) {
return $response;
}
// Time to remove maintenance mode. Bulk edit handles this separately.
if ( ! $this->bulk ) {
$this->maintenance_mode( false );
}
return $response;
}
Changelog
Version | Description |
---|---|
5.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.