Theme_Upgrader::current_after( bool|WP_Error $return, array $theme )

Turn off maintenance mode after upgrading the current theme.


Description Description

Hooked to the ‘upgrader_post_install’ filter by Theme_Upgrader::upgrade() and Theme_Upgrader::bulk_upgrade().


Parameters Parameters

$return

(bool|WP_Error) (Required)

$theme

(array) (Required)


Top ↑

Return Return

(bool|WP_Error)


Top ↑

Source Source

File: wp-admin/includes/class-theme-upgrader.php

	public function current_after( $return, $theme ) {
		if ( is_wp_error( $return ) ) {
			return $return;
		}

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

		if ( $theme != get_stylesheet() ) { // If not current
			return $return;
		}

		// Ensure stylesheet name hasn't changed after the upgrade:
		if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
			wp_clean_themes_cache();
			$stylesheet = $this->result['destination_name'];
			switch_theme( $stylesheet );
		}

		//Time to remove maintenance mode
		if ( ! $this->bulk ) {
			$this->maintenance_mode( false );
		}
		return $return;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.