]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/includes/class-bulk-theme-upgrader-skin.php
Wordpress 4.6-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-bulk-theme-upgrader-skin.php
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 Theme Upgrader Skin for WordPress Theme 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_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
19         public $theme_info = array(); // Theme_Upgrader::bulk() will fill this in.
20
21         public function add_strings() {
22                 parent::add_strings();
23                 $this->upgrader->strings['skin_before_update_header'] = __('Updating Theme %1$s (%2$d/%3$d)');
24         }
25
26         /**
27          *
28          * @param string $title
29          */
30         public function before($title = '') {
31                 parent::before( $this->theme_info->display('Name') );
32         }
33
34         /**
35          *
36          * @param string $title
37          */
38         public function after($title = '') {
39                 parent::after( $this->theme_info->display('Name') );
40                 $this->decrement_update_count( 'theme' );
41         }
42
43         /**
44          * @access public
45          */
46         public function bulk_footer() {
47                 parent::bulk_footer();
48                 $update_actions =  array(
49                         'themes_page' => '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>',
50                         'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>'
51                 );
52                 if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) )
53                         unset( $update_actions['themes_page'] );
54
55                 /**
56                  * Filters the list of action links available following bulk theme updates.
57                  *
58                  * @since 3.0.0
59                  *
60                  * @param array $update_actions Array of theme action links.
61                  * @param array $theme_info     Array of information for the last-updated theme.
62                  */
63                 $update_actions = apply_filters( 'update_bulk_theme_complete_actions', $update_actions, $this->theme_info );
64
65                 if ( ! empty($update_actions) )
66                         $this->feedback(implode(' | ', (array)$update_actions));
67         }
68 }