wp/wp-admin/includes/class-bulk-theme-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_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
    18 class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
    19 	public $theme_info = array(); // Theme_Upgrader::bulk_upgrade() will fill this in.
       
    20 
    19 
       
    20 	/**
       
    21 	 * Theme info.
       
    22 	 *
       
    23 	 * The Theme_Upgrader::bulk_upgrade() method will fill this in
       
    24 	 * with info retrieved from the Theme_Upgrader::theme_info() method,
       
    25 	 * which in turn calls the wp_get_theme() function.
       
    26 	 *
       
    27 	 * @since 3.0.0
       
    28 	 * @var WP_Theme|false The theme's info object, or false.
       
    29 	 */
       
    30 	public $theme_info = false;
       
    31 
       
    32 	/**
       
    33 	 * Sets up the strings used in the update process.
       
    34 	 *
       
    35 	 * @since 3.0.0
       
    36 	 */
    21 	public function add_strings() {
    37 	public function add_strings() {
    22 		parent::add_strings();
    38 		parent::add_strings();
    23 		/* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */
    39 		/* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */
    24 		$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Theme %1$s (%2$d/%3$d)' );
    40 		$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Theme %1$s (%2$d/%3$d)' );
    25 	}
    41 	}
    26 
    42 
    27 	/**
    43 	/**
       
    44 	 * Performs an action before a bulk theme update.
       
    45 	 *
       
    46 	 * @since 3.0.0
       
    47 	 *
    28 	 * @param string $title
    48 	 * @param string $title
    29 	 */
    49 	 */
    30 	public function before( $title = '' ) {
    50 	public function before( $title = '' ) {
    31 		parent::before( $this->theme_info->display( 'Name' ) );
    51 		parent::before( $this->theme_info->display( 'Name' ) );
    32 	}
    52 	}
    33 
    53 
    34 	/**
    54 	/**
       
    55 	 * Performs an action following a bulk theme update.
       
    56 	 *
       
    57 	 * @since 3.0.0
       
    58 	 *
    35 	 * @param string $title
    59 	 * @param string $title
    36 	 */
    60 	 */
    37 	public function after( $title = '' ) {
    61 	public function after( $title = '' ) {
    38 		parent::after( $this->theme_info->display( 'Name' ) );
    62 		parent::after( $this->theme_info->display( 'Name' ) );
    39 		$this->decrement_update_count( 'theme' );
    63 		$this->decrement_update_count( 'theme' );
    40 	}
    64 	}
    41 
    65 
    42 	/**
    66 	/**
       
    67 	 * Displays the footer following the bulk update process.
       
    68 	 *
       
    69 	 * @since 3.0.0
    43 	 */
    70 	 */
    44 	public function bulk_footer() {
    71 	public function bulk_footer() {
    45 		parent::bulk_footer();
    72 		parent::bulk_footer();
    46 
    73 
    47 		$update_actions = array(
    74 		$update_actions = array(