Plugin_Upgrader::active_before

Advertisement

Summery Summery

Turns on maintenance mode before attempting to background update an active plugin.

Syntax Syntax

Plugin_Upgrader::active_before( bool|WP_Error $return, array $plugin )

Description Description

Hooked to the ‘upgrader_pre_install’ filter by Plugin_Upgrader::upgrade().

Parameters Parameters

$return

(Required) Upgrade offer return.

$plugin

(Required) Plugin package arguments.

Return Return

(bool|WP_Error) The passed in $return param or WP_Error.

Source Source

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

		if ( ! is_wp_version_compatible( $requires_wp ) ) {
			$error = sprintf(
				/* translators: 1: Current WordPress version, 2: Version required by the uploaded plugin. */
				__( 'Your WordPress version is %1$s, however the uploaded plugin requires %2$s.' ),
				$GLOBALS['wp_version'],
				$requires_wp
			);

			return new WP_Error( 'incompatible_wp_required_version', $this->strings['incompatible_archive'], $error );
		}

		return $source;
	}

	/**
	 * Retrieve the path to the file that contains the plugin info.
	 *
	 * This isn't used internally in the class, but is called by the skins.
	 *
	 * @since 2.8.0
	 *
	 * @return string|false The full path to the main plugin file, or false.
	 */

Advertisement

Changelog Changelog

Changelog
Version Description
5.4.0 Introduced.

Advertisement

Leave a Reply