Bulk_Upgrader_Skin::feedback( string $feedback, mixed $args )

In this article

Displays a message about the update.

Parameters

$feedbackstringrequired
Message data.
$argsmixedoptional
Optional text replacements.

Source

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 {
		echo "<p>$feedback</p>\n";
	}
}

Changelog

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

User Contributed Notes

You must log in before being able to contribute a note or feedback.