/wp-admin/includes/class-bulk-theme-upgrader-skin.php

https://bitbucket.org/devbctph/futura_wp · PHP · 67 lines · 27 code · 7 blank · 33 comment · 3 complexity · 0f138ac4c54c7451647a0e954c41cbe1 MD5 · raw file

  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. */
  40. public function bulk_footer() {
  41. parent::bulk_footer();
  42. $update_actions = array(
  43. 'themes_page' => '<a href="' . self_admin_url( 'themes.php' ) . '" target="_parent">' . __( 'Return to Themes page' ) . '</a>',
  44. 'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>'
  45. );
  46. if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) )
  47. unset( $update_actions['themes_page'] );
  48. /**
  49. * Filters the list of action links available following bulk theme updates.
  50. *
  51. * @since 3.0.0
  52. *
  53. * @param array $update_actions Array of theme action links.
  54. * @param array $theme_info Array of information for the last-updated theme.
  55. */
  56. $update_actions = apply_filters( 'update_bulk_theme_complete_actions', $update_actions, $this->theme_info );
  57. if ( ! empty($update_actions) )
  58. $this->feedback(implode(' | ', (array)$update_actions));
  59. }
  60. }