Summery Summery
Turns off maintenance mode after upgrading an active plugin.
Syntax Syntax
Description Description
Hooked to the ‘upgrader_post_install’ filter by Plugin_Upgrader::upgrade().
Parameters Parameters
- $return
-
(Required) Upgrade offer return.
- $plugin
-
(Required) Plugin package arguments.
Return Return
Source Source
File: wp-admin/includes/class-plugin-upgrader.php
}
// Assume the requested plugin is the first in the list.
$pluginfiles = array_keys( $plugin );
return $this->result['destination_name'] . '/' . $pluginfiles[0];
}
/**
* Deactivates a plugin before it is upgraded.
*
* Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade().
*
* @since 2.8.0
* @since 4.1.0 Added a return value.
*
* @param bool|WP_Error $return Upgrade offer return.
* @param array $plugin Plugin package arguments.
* @return bool|WP_Error The passed in $return param or WP_Error.
*/
public function deactivate_plugin_before_upgrade( $return, $plugin ) {
if ( is_wp_error( $return ) ) { // Bypass.
return $return;
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 5.4.0 | Introduced. |