wp/wp-admin/includes/class-bulk-plugin-upgrader-skin.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    14  * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
    14  * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.
    15  *
    15  *
    16  * @see Bulk_Upgrader_Skin
    16  * @see Bulk_Upgrader_Skin
    17  */
    17  */
    18 class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
    18 class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
    19 	public $plugin_info = array(); // Plugin_Upgrader::bulk_upgrade() will fill this in.
       
    20 
    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 	 * @since 3.0.0
       
    27 	 * @var array Plugin data. Values will be empty if not supplied by the plugin.
       
    28 	 */
       
    29 	public $plugin_info = array();
       
    30 
       
    31 	/**
       
    32 	 * Sets up the strings used in the update process.
       
    33 	 *
       
    34 	 * @since 3.0.0
       
    35 	 */
    21 	public function add_strings() {
    36 	public function add_strings() {
    22 		parent::add_strings();
    37 		parent::add_strings();
    23 		/* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */
    38 		/* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */
    24 		$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );
    39 		$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)' );
    25 	}
    40 	}
    26 
    41 
    27 	/**
    42 	/**
       
    43 	 * Performs an action before a bulk plugin update.
       
    44 	 *
       
    45 	 * @since 3.0.0
       
    46 	 *
    28 	 * @param string $title
    47 	 * @param string $title
    29 	 */
    48 	 */
    30 	public function before( $title = '' ) {
    49 	public function before( $title = '' ) {
    31 		parent::before( $this->plugin_info['Title'] );
    50 		parent::before( $this->plugin_info['Title'] );
    32 	}
    51 	}
    33 
    52 
    34 	/**
    53 	/**
       
    54 	 * Performs an action following a bulk plugin update.
       
    55 	 *
       
    56 	 * @since 3.0.0
       
    57 	 *
    35 	 * @param string $title
    58 	 * @param string $title
    36 	 */
    59 	 */
    37 	public function after( $title = '' ) {
    60 	public function after( $title = '' ) {
    38 		parent::after( $this->plugin_info['Title'] );
    61 		parent::after( $this->plugin_info['Title'] );
    39 		$this->decrement_update_count( 'plugin' );
    62 		$this->decrement_update_count( 'plugin' );
    40 	}
    63 	}
    41 
    64 
    42 	/**
    65 	/**
       
    66 	 * Displays the footer following the bulk update process.
       
    67 	 *
       
    68 	 * @since 3.0.0
    43 	 */
    69 	 */
    44 	public function bulk_footer() {
    70 	public function bulk_footer() {
    45 		parent::bulk_footer();
    71 		parent::bulk_footer();
    46 
    72 
    47 		$update_actions = array(
    73 		$update_actions = array(