WordPress at Your Fingertips
function is not described

Bulk_Upgrader_Skin::error() public WP 1.0

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

No Hooks.

Return

null. Nothing.

Usage

$Bulk_Upgrader_Skin = new Bulk_Upgrader_Skin();
$Bulk_Upgrader_Skin->error( $error );
$error *(string WP_Error) (required)*

Code of Bulk_Upgrader_Skin::error() WP 5.8.2

public function error( $error ) {
	if ( is_string( $error ) && isset( $this->upgrader->strings[ $error ] ) ) {
		$this->error = $this->upgrader->strings[ $error ];
	}

	if ( is_wp_error( $error ) ) {
		$messages = array();
		foreach ( $error->get_error_messages() as $emessage ) {
			if ( $error->get_error_data() && is_string( $error->get_error_data() ) ) {
				$messages[] = $emessage . ' ' . esc_html( strip_tags( $error->get_error_data() ) );
			} else {
				$messages[] = $emessage;
			}
		}
		$this->error = implode( ', ', $messages );
	}
	echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
}