wppaste
WordPress

Plugin_Upgrader_Skin

Since
2.8.0, 4.6.0
Source
wp-admin/includes/class-plugin-upgrader-skin.php:18
Plugin Upgrader Skin for WordPress Plugin Upgrades.

Compatibility

WordPress
since 4.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 1

Every hook that fires from inside Plugin_Upgrader_Skin, in the order it appears in the class, grouped by the method that fires it.

Properties · 3

$pluginstringpublic
Holds the plugin slug in the Plugin Directory.
$plugin_activeboolpublic
Whether the plugin is active.
$plugin_network_activeboolpublic
Whether the plugin is active for the entire network.

Methods · 2

Source code

class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { 	/**	 * Holds the plugin slug in the Plugin Directory.	 *	 * @since 2.8.0	 *	 * @var string	 */	public $plugin = ''; 	/**	 * Whether the plugin is active.	 *	 * @since 2.8.0	 *	 * @var bool	 */	public $plugin_active = false; 	/**	 * Whether the plugin is active for the entire network.	 *	 * @since 2.8.0	 *	 * @var bool	 */	public $plugin_network_active = false; 	/**	 * Constructor.	 *	 * Sets up the plugin upgrader skin.	 *	 * @since 2.8.0	 *	 * @param array $args Optional. The plugin upgrader skin arguments to	 *                    override default options. Default empty array.	 */	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 );	} 	/**	 * Performs an action following a single plugin update.	 *	 * @since 2.8.0	 */	public function after() {		$this->plugin = $this->upgrader->plugin_info();		if ( ! empty( $this->plugin ) && ! is_wp_error( $this->result ) && $this->plugin_active ) {			// Currently used only when JS is off for a single plugin update?			printf(				'<iframe title="%s" style="border:0;overflow:hidden" width="100%%" height="170" src="%s"></iframe>',				esc_attr__( 'Update progress' ),				wp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin )			);		} 		$this->decrement_update_count( 'plugin' ); 		$update_actions = array(			'activate_plugin' => sprintf(				'<a href="%s" target="_parent">%s</a>',				wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ),				__( 'Activate Plugin' )			),

Changelog

Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.6.0
Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.from the docblock
2.8.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-admin/includes/class-plugin-upgrader-skin.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.