WP_Error::get_error_codes()publicWP 2.1.0

Retrieves all error codes.

Method of the class: WP_Error{}

No Hooks.

Return

Array. List of error codes, if available.

Usage

$WP_Error = new WP_Error();
$WP_Error->get_error_codes();

Changelog

Since 2.1.0 Introduced.

WP_Error::get_error_codes() code WP 6.6.2

public function get_error_codes() {
	if ( ! $this->has_errors() ) {
		return array();
	}

	return array_keys( $this->errors );
}