wppaste
WordPress

Bulk_Upgrader_Skin

Since
3.0.0, 4.6.0
Source
wp-admin/includes/class-bulk-upgrader-skin.php:18
Generic Bulk Upgrader Skin for WordPress 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).

Properties · 2

$in_loopboolpublic
Whether the bulk update process has started.
$errorstring|falsepublic
Stores an error message about the update.

Methods · 12

  • __construct()Constructor.
  • add_strings()Sets up the strings used in the update process.
  • feedback()Displays a message about the update.
  • header()Displays the header before the update process.
  • footer()Displays the footer following the update process.
  • error()Displays an error message about the update.
  • bulk_header()Displays the header before the bulk update process.
  • bulk_footer()Displays the footer following the bulk update process.
  • before()Performs an action before a bulk update.
  • after()Performs an action following a bulk update.
  • reset()Resets the properties used in the update process.
  • flush_output()Flushes all output buffers.

Source code

class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { 	/**	 * Whether the bulk update process has started.	 *	 * @since 3.0.0	 * @var bool	 */	public $in_loop = false; 	/**	 * Stores an error message about the update.	 *	 * @since 3.0.0	 * @var string|false	 */	public $error = false; 	/**	 * Constructor.	 *	 * Sets up the generic skin for the Bulk Upgrader classes.	 *	 * @since 3.0.0	 *	 * @param array $args	 */	public function __construct( $args = array() ) {		$defaults = array(			'url'   => '',			'nonce' => '',		);		$args     = wp_parse_args( $args, $defaults ); 		parent::__construct( $args );	} 	/**	 * Sets up the strings used in the update process.	 *	 * @since 3.0.0	 */	public function add_strings() {		$this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' );		/* translators: 1: Title of an update, 2: Error message. */		$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while updating %1$s: %2$s' );		/* translators: %s: Title of an update. */		$this->upgrader->strings['skin_update_failed'] = __( 'The update of %s failed.' );		/* translators: %s: Title of an update. */		$this->upgrader->strings['skin_update_successful'] = __( '%s updated successfully.' );		$this->upgrader->strings['skin_upgrade_end']       = __( 'All updates have been completed.' );	} 	/**	 * Displays a message about the update.	 *	 * @since 3.0.0	 * @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support.	 *	 * @param string $feedback Message data.	 * @param mixed  ...$args  Optional text replacements.	 */	public function feedback( $feedback, ...$args ) {		if ( isset( $this->upgrader->strings[ $feedback ] ) ) {			$feedback = $this->upgrader->strings[ $feedback ];		} 		if ( str_contains( $feedback, '%' ) ) {			if ( $args ) {				$args     = array_map( 'strip_tags', $args );				$args     = array_map( 'esc_html', $args );				$feedback = vsprintf( $feedback, $args );			}		}		if ( empty( $feedback ) ) {			return;		}		if ( $this->in_loop ) {			echo "$feedback<br />\n";		} else {

Changelog

Introduced in 3.0.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.0.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-admin/includes/class-bulk-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.