WP_Upgrader_Skin::feedback() WordPress Method

The WP_Upgrader_Skin::feedback() method is used to give feedback to the user during the upgrade process. The feedback is displayed in the form of a progress bar and a status message.

WP_Upgrader_Skin::feedback( string $feedback, mixed $args ) #


Parameters

$feedback

(string)(Required)Message data.

$args

(mixed)(Optional)text replacements.


Top ↑

Source

File: wp-admin/includes/class-wp-upgrader-skin.php

	public function feedback( $feedback, ...$args ) {
		if ( isset( $this->upgrader->strings[ $feedback ] ) ) {
			$feedback = $this->upgrader->strings[ $feedback ];
		}

		if ( strpos( $feedback, '%' ) !== false ) {
			if ( $args ) {
				$args     = array_map( 'strip_tags', $args );
				$args     = array_map( 'esc_html', $args );
				$feedback = vsprintf( $feedback, $args );
			}
		}
		if ( empty( $feedback ) ) {
			return;
		}
		show_message( $feedback );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Renamed $string (a PHP reserved keyword) to $feedback for PHP 8 named parameter support.
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.