WP_Ajax_Upgrader_Skin::get_error_messages() WordPress Method

The WP_Ajax_Upgrader_Skin::get_error_messages() method retrieves any error messages that have been generated during the upgrade process. This can be useful for debugging purposes or for displaying informative messages to the user.

WP_Ajax_Upgrader_Skin::get_error_messages() #

Retrieves a string for error messages.


Return

(string) Error messages during an upgrade.


Top ↑

Source

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

	public function get_error_messages() {
		$messages = array();

		foreach ( $this->errors->get_error_codes() as $error_code ) {
			$error_data = $this->errors->get_error_data( $error_code );

			if ( $error_data && is_string( $error_data ) ) {
				$messages[] = $this->errors->get_error_message( $error_code ) . ' ' . esc_html( strip_tags( $error_data ) );
			} else {
				$messages[] = $this->errors->get_error_message( $error_code );
			}
		}

		return implode( ', ', $messages );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.6.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.