W3cubDocs

/WordPress

WP_Upgrader_Skin::error( string|WP_Error $errors )

Displays an error message about the update.

Parameters

$errorsstring|WP_Errorrequired
Errors.

Source

public function error( $errors ) {
	if ( ! $this->done_header ) {
		$this->header();
	}
	if ( is_string( $errors ) ) {
		$this->feedback( $errors );
	} elseif ( is_wp_error( $errors ) && $errors->has_errors() ) {
		foreach ( $errors->get_error_messages() as $message ) {
			if ( $errors->get_error_data() && is_string( $errors->get_error_data() ) ) {
				$this->feedback( $message . ' ' . esc_html( strip_tags( $errors->get_error_data() ) ) );
			} else {
				$this->feedback( $message );
			}
		}
	}
}

Changelog

Version Description
2.8.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_upgrader_skin/error