選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

69 行
1.9 KiB

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