WordPress at Your Fingertips
function is not described

Automatic_Upgrader_Skin::feedback() public WP 3.7.0

Stores a message about the upgrade.

{} It's a method of the class: Automatic_Upgrader_Skin{}

No Hooks.

Return

null. Nothing.

Usage

$Automatic_Upgrader_Skin = new Automatic_Upgrader_Skin();
$Automatic_Upgrader_Skin->feedback( $data, ...$args );
$data(string|array|WP_Error) (required)
Message data.
...$args(mixed) (required)
Optional text replacements.

Changelog

Since 3.7.0 Introduced.

Code of Automatic_Upgrader_Skin::feedback() WP 5.8.2

public function feedback( $data, ...$args ) {
	if ( is_wp_error( $data ) ) {
		$string = $data->get_error_message();
	} elseif ( is_array( $data ) ) {
		return;
	} else {
		$string = $data;
	}
	if ( ! empty( $this->upgrader->strings[ $string ] ) ) {
		$string = $this->upgrader->strings[ $string ];
	}

	if ( strpos( $string, '%' ) !== false ) {
		if ( ! empty( $args ) ) {
			$string = vsprintf( $string, $args );
		}
	}

	$string = trim( $string );

	// Only allow basic HTML in the messages, as it'll be used in emails/logs rather than direct browser output.
	$string = wp_kses(
		$string,
		array(
			'a'      => array(
				'href' => true,
			),
			'br'     => true,
			'em'     => true,
			'strong' => true,
		)
	);

	if ( empty( $string ) ) {
		return;
	}

	$this->messages[] = $string;
}