WP_Error::get_error_code(): string|int

In this article

Retrieves the first error code available.

Return

string|int Empty string, if no error codes.

Source

public function get_error_code() {
	$codes = $this->get_error_codes();

	if ( empty( $codes ) ) {
		return '';
	}

	return $codes[0];
}

Changelog

VersionDescription
2.1.0Introduced.

User Contributed Notes

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