/wp-admin/includes/class-bulk-plugin-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 Plugin Upgrader Skin for WordPress Plugin 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_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin { 
  19. public $plugin_info = array(); // Plugin_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 Plugin %1$s (%2$d/%3$d)'); 
  24.  
  25. /** 
  26. * 
  27. * @param string $title 
  28. */ 
  29. public function before($title = '') { 
  30. parent::before($this->plugin_info['Title']); 
  31.  
  32. /** 
  33. * 
  34. * @param string $title 
  35. */ 
  36. public function after($title = '') { 
  37. parent::after($this->plugin_info['Title']); 
  38. $this->decrement_update_count( 'plugin' ); 
  39.  
  40. /** 
  41. * @access public 
  42. */ 
  43. public function bulk_footer() { 
  44. parent::bulk_footer(); 
  45. $update_actions = array( 
  46. 'plugins_page' => '<a href="' . self_admin_url( 'plugins.php' ) . '" target="_parent">' . __( 'Return to Plugins page' ) . '</a>',  
  47. 'updates_page' => '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>' 
  48. ); 
  49. if ( ! current_user_can( 'activate_plugins' ) ) 
  50. unset( $update_actions['plugins_page'] ); 
  51.  
  52. /** 
  53. * Filters the list of action links available following bulk plugin updates. 
  54. * 
  55. * @since 3.0.0 
  56. * 
  57. * @param array $update_actions Array of plugin action links. 
  58. * @param array $plugin_info Array of information for the last-updated plugin. 
  59. */ 
  60. $update_actions = apply_filters( 'update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); 
  61.  
  62. if ( ! empty($update_actions) ) 
  63. $this->feedback(implode(' | ', (array)$update_actions)); 
.