WP_Error::get_error_data( string|int $code =  ): mixed

In this article

Retrieves the most recently added error data for an error code.

Parameters

$codestring|intoptional
Error code.

Default:''

Return

mixed Error data, if it exists.

Source

public function get_error_data( $code = '' ) {
	if ( empty( $code ) ) {
		$code = $this->get_error_code();
	}

	if ( isset( $this->error_data[ $code ] ) ) {
		return $this->error_data[ $code ];
	}
}

Changelog

VersionDescription
2.1.0Introduced.

User Contributed Notes

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