Plugin_Upgrader_Skin::__construct() WordPress Method

The Plugin_Upgrader_Skin class is used to display updates to plugins in the WordPress Dashboard. The class can also be used to create a custom plugin update experience. Plugin_Upgrader_Skin::__construct() takes two arguments. The first argument is an instance of the Plugin_Upgrader class. The second argument is an array of options. The class provides two methods for displaying plugin updates. Plugin_Upgrader_Skin::inject_update_info() can be used to display plugin updates in the WordPress Dashboard. Plugin_Upgrader_Skin::inject_update_info_header() can be used to display plugin updates in a custom plugin update experience.

Plugin_Upgrader_Skin::__construct( array $args = array() ) #

Constructor.


Description

Sets up the plugin upgrader skin.


Top ↑

Parameters

$args

(array)(Optional) The plugin upgrader skin arguments to override default options.

Default value: array()


Top ↑

Source

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

	public function __construct( $args = array() ) {
		$defaults = array(
			'url'    => '',
			'plugin' => '',
			'nonce'  => '',
			'title'  => __( 'Update Plugin' ),
		);
		$args     = wp_parse_args( $args, $defaults );

		$this->plugin = $args['plugin'];

		$this->plugin_active         = is_plugin_active( $this->plugin );
		$this->plugin_network_active = is_plugin_active_for_network( $this->plugin );

		parent::__construct( $args );
	}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.