[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> class-bulk-plugin-upgrader-skin.php (source)

   1  <?php
   2  /**
   3   * Upgrader API: Bulk_Plugin_Upgrader_Skin class
   4   *
   5   * @package WordPress
   6   * @subpackage Upgrader
   7   * @since 4.6.0
   8   */
   9  
  10  /**
  11   * Bulk Plugin Upgrader Skin for WordPress Plugin Upgrades.
  12   *
  13   * @since 3.0.0
  14   * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
  15   *
  16   * @see Bulk_Upgrader_Skin
  17   */
  18  class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
  19  
  20      /**
  21       * Plugin info.
  22       *
  23       * The Plugin_Upgrader::bulk_upgrade() method will fill this in
  24       * with info retrieved from the get_plugin_data() function.
  25       *
  26       * @var array Plugin data. Values will be empty if not supplied by the plugin.
  27       */
  28      public $plugin_info = array();
  29  
  30  	public function add_strings() {
  31          parent::add_strings();
  32          /* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */
  33          $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );
  34      }
  35  
  36      /**
  37       * @param string $title
  38       */
  39  	public function before( $title = '' ) {
  40          parent::before( $this->plugin_info['Title'] );
  41      }
  42  
  43      /**
  44       * @param string $title
  45       */
  46  	public function after( $title = '' ) {
  47          parent::after( $this->plugin_info['Title'] );
  48          $this->decrement_update_count( 'plugin' );
  49      }
  50  
  51      /**
  52       */
  53  	public function bulk_footer() {
  54          parent::bulk_footer();
  55  
  56          $update_actions = array(
  57              'plugins_page' => sprintf(
  58                  '<a href="%s" target="_parent">%s</a>',
  59                  self_admin_url( 'plugins.php' ),
  60                  __( 'Go to Plugins page' )
  61              ),
  62              'updates_page' => sprintf(
  63                  '<a href="%s" target="_parent">%s</a>',
  64                  self_admin_url( 'update-core.php' ),
  65                  __( 'Go to WordPress Updates page' )
  66              ),
  67          );
  68  
  69          if ( ! current_user_can( 'activate_plugins' ) ) {
  70              unset( $update_actions['plugins_page'] );
  71          }
  72  
  73          /**
  74           * Filters the list of action links available following bulk plugin updates.
  75           *
  76           * @since 3.0.0
  77           *
  78           * @param string[] $update_actions Array of plugin action links.
  79           * @param array    $plugin_info    Array of information for the last-updated plugin.
  80           */
  81          $update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
  82  
  83          if ( ! empty( $update_actions ) ) {
  84              $this->feedback( implode( ' | ', (array) $update_actions ) );
  85          }
  86      }
  87  }


Generated : Sat Apr 20 08:20:01 2024 Cross-referenced by PHPXref