WordPress at Your Fingertips
function is not described

Plugin_Upgrader::active_after() public WP 5.4.0

Turns off maintenance mode after upgrading an active plugin.

Hooked to the upgrader_post_install filter by Plugin_Upgrader::upgrade().

{} It's a method of the class: Plugin_Upgrader{}

No Hooks.

Return

true|false|WP_Error. The passed in $return param or WP_Error.

Usage

$Plugin_Upgrader = new Plugin_Upgrader();
$Plugin_Upgrader->active_after( $return, $plugin );
$return(true|false|WP_Error) (required)
Upgrade offer return.
$plugin(array) (required)
Plugin package arguments.

Changelog

Since 5.4.0 Introduced.

Code of Plugin_Upgrader::active_after() WP 5.8.2

public function active_after( $return, $plugin ) {
	if ( is_wp_error( $return ) ) {
		return $return;
	}

	// Only disable maintenance mode when in cron (background update).
	if ( ! wp_doing_cron() ) {
		return $return;
	}

	$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';

	// Only run if plugin is active
	if ( ! is_plugin_active( $plugin ) ) {
		return $return;
	}

	// Time to remove maintenance mode. Bulk edit handles this separately.
	if ( ! $this->bulk ) {
		$this->maintenance_mode( false );
	}

	return $return;
}