Plugin_Upgrader_Skin

Plugin Upgrader Skin for WordPress Plugin Upgrades.

Defined (1)

The class is defined in the following location(s).

/wp-admin/includes/class-plugin-upgrader-skin.php  
  1. class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { 
  2. public $plugin = ''; 
  3. public $plugin_active = false; 
  4. public $plugin_network_active = false; 
  5.  
  6. /** 
  7. * @param array $args 
  8. */ 
  9. public function __construct( $args = array() ) { 
  10. $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Update Plugin') ); 
  11. $args = wp_parse_args($args, $defaults); 
  12.  
  13. $this->plugin = $args['plugin']; 
  14.  
  15. $this->plugin_active = is_plugin_active( $this->plugin ); 
  16. $this->plugin_network_active = is_plugin_active_for_network( $this->plugin ); 
  17.  
  18. parent::__construct($args); 
  19.  
  20. /** 
  21. * @access public 
  22. */ 
  23. public function after() { 
  24. $this->plugin = $this->upgrader->plugin_info(); 
  25. if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ) { 
  26. // Currently used only when JS is off for a single plugin update? 
  27. echo '<iframe title="' . esc_attr__( 'Update progress' ) . '" style="border:0;overflow:hidden" width="100%" height="170" src="' . wp_nonce_url( 'update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ) . '"></iframe>'; 
  28.  
  29. $this->decrement_update_count( 'plugin' ); 
  30.  
  31. $update_actions = array( 
  32. 'activate_plugin' => '<a href="' . wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) . '" target="_parent">' . __( 'Activate Plugin' ) . '</a>',  
  33. 'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>' 
  34. ); 
  35. if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugins' ) ) 
  36. unset( $update_actions['activate_plugin'] ); 
  37.  
  38. /** 
  39. * Filters the list of action links available following a single plugin update. 
  40. * @since 2.7.0 
  41. * @param array $update_actions Array of plugin action links. 
  42. * @param string $plugin Path to the plugin file. 
  43. */ 
  44. $update_actions = apply_filters( 'update_plugin_complete_actions', $update_actions, $this->plugin ); 
  45.  
  46. if ( ! empty($update_actions) ) 
  47. $this->feedback(implode(' | ', (array)$update_actions));