Language_Pack_Upgrader_Skin

Translation Upgrader Skin for WordPress Translation Upgrades.

Defined (1)

The class is defined in the following location(s).

/wp-admin/includes/class-language-pack-upgrader-skin.php  
  1. class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin { 
  2. public $language_update = null; 
  3. public $done_header = false; 
  4. public $done_footer = false; 
  5. public $display_footer_actions = true; 
  6.  
  7. /** 
  8. * @param array $args 
  9. */ 
  10. public function __construct( $args = array() ) { 
  11. $defaults = array( 'url' => '', 'nonce' => '', 'title' => __( 'Update Translations' ), 'skip_header_footer' => false ); 
  12. $args = wp_parse_args( $args, $defaults ); 
  13. if ( $args['skip_header_footer'] ) { 
  14. $this->done_header = true; 
  15. $this->done_footer = true; 
  16. $this->display_footer_actions = false; 
  17. parent::__construct( $args ); 
  18.  
  19. /** 
  20. * @access public 
  21. */ 
  22. public function before() { 
  23. $name = $this->upgrader->get_name_for_update( $this->language_update ); 
  24.  
  25. echo '<div class="update-messages lp-show-latest">'; 
  26.  
  27. printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)…' ) . '</h2>', $name, $this->language_update->language ); 
  28.  
  29. /** 
  30. * @param string|WP_Error $error 
  31. */ 
  32. public function error( $error ) { 
  33. echo '<div class="lp-error">'; 
  34. parent::error( $error ); 
  35. echo '</div>'; 
  36.  
  37. /** 
  38. * @access public 
  39. */ 
  40. public function after() { 
  41. echo '</div>'; 
  42.  
  43. /** 
  44. * @access public 
  45. */ 
  46. public function bulk_footer() { 
  47. $this->decrement_update_count( 'translation' ); 
  48. $update_actions = array(); 
  49. $update_actions['updates_page'] = '<a href="' . self_admin_url( 'update-core.php' ) . '" target="_parent">' . __( 'Return to WordPress Updates page' ) . '</a>'; 
  50.  
  51. /** 
  52. * Filters the list of action links available following a translations update. 
  53. * @since 3.7.0 
  54. * @param array $update_actions Array of translations update links. 
  55. */ 
  56. $update_actions = apply_filters( 'update_translations_complete_actions', $update_actions ); 
  57.  
  58. if ( $update_actions && $this->display_footer_actions ) 
  59. $this->feedback( implode( ' | ', $update_actions ) );