wppaste
WordPress

Language_Pack_Upgrader_Skin

Since
3.7.0, 4.6.0
Source
wp-admin/includes/class-language-pack-upgrader-skin.php:18
Translation Upgrader Skin for WordPress Translation Upgrades.

Compatibility

WordPress
since 4.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 1

Every hook that fires from inside Language_Pack_Upgrader_Skin, in the order it appears in the class, grouped by the method that fires it.

Properties · 4

$language_updatepublic
$done_headerpublic

Methods · 5

  • __construct()Constructor.
  • before()Performs an action before a language pack update.
  • error()Displays an error message about the update.
  • after()Performs an action following a language pack update.
  • bulk_footer()Displays the footer following the bulk update process.

Source code

class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {	public $language_update        = null;	public $done_header            = false;	public $done_footer            = false;	public $display_footer_actions = true; 	/**	 * Constructor.	 *	 * Sets up the language pack upgrader skin.	 *	 * @since 3.7.0	 *	 * @param array $args	 */	public function __construct( $args = array() ) {		$defaults = array(			'url'                => '',			'nonce'              => '',			'title'              => __( 'Update Translations' ),			'skip_header_footer' => false,		);		$args     = wp_parse_args( $args, $defaults );		if ( $args['skip_header_footer'] ) {			$this->done_header            = true;			$this->done_footer            = true;			$this->display_footer_actions = false;		}		parent::__construct( $args );	} 	/**	 * Performs an action before a language pack update.	 *	 * @since 3.7.0	 */	public function before() {		$name = $this->upgrader->get_name_for_update( $this->language_update ); 		echo '<div class="update-messages lp-show-latest">'; 		/* translators: 1: Project name (plugin, theme, or WordPress), 2: Language. */		printf( '<h2>' . __( 'Updating translations for %1$s (%2$s)&#8230;' ) . '</h2>', $name, $this->language_update->language );	} 	/**	 * Displays an error message about the update.	 *	 * @since 3.7.0	 * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.	 *	 * @param string|WP_Error $errors Errors.	 */	public function error( $errors ) {		echo '<div class="lp-error">';		parent::error( $errors );		echo '</div>';	} 	/**	 * Performs an action following a language pack update.	 *	 * @since 3.7.0	 */	public function after() {		echo '</div>';	} 	/**	 * Displays the footer following the bulk update process.	 *	 * @since 3.7.0	 */	public function bulk_footer() {		$this->decrement_update_count( 'translation' ); 		$update_actions = array(			'updates_page' => sprintf(				'<a href="%s" target="_parent">%s</a>',				self_admin_url( 'update-core.php' ),

Changelog

Introduced in 3.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.6.0
Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php.from the docblock
3.7.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-admin/includes/class-language-pack-upgrader-skin.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.