Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

69 linhas
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 Plugin Upgrader Skin for WordPress Plugin 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_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
  18. public $plugin_info = array(); // Plugin_Upgrader::bulk() will fill this in.
  19. public function add_strings() {
  20. parent::add_strings();
  21. $this->upgrader->strings['skin_before_update_header'] = __('Updating Plugin %1$s (%2$d/%3$d)');
  22. }
  23. /**
  24. *
  25. * @param string $title
  26. */
  27. public function before($title = '') {
  28. parent::before($this->plugin_info['Title']);
  29. }
  30. /**
  31. *
  32. * @param string $title
  33. */
  34. public function after($title = '') {
  35. parent::after($this->plugin_info['Title']);
  36. $this->decrement_update_count( 'plugin' );
  37. }
  38. /**
  39. * @access public
  40. */
  41. public function bulk_footer() {
  42. parent::bulk_footer();
  43. $update_actions = array(
  44. 'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins 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( 'activate_plugins' ) )
  48. unset( $update_actions['plugins_page'] );
  49. /**
  50. * Filters the list of action links available following bulk plugin updates.
  51. *
  52. * @since 3.0.0
  53. *
  54. * @param array $update_actions Array of plugin action links.
  55. * @param array $plugin_info Array of information for the last-updated plugin.
  56. */
  57. $update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
  58. if ( ! empty($update_actions) )
  59. $this->feedback(implode(' | ', (array)$update_actions));
  60. }
  61. }