WP_Error::has_errorspublicWP 5.1.0

Verifies if the instance contains errors.

Method of the class: WP_Error{}

No Hooks.

Returns

true|false. If the instance contains errors.

Usage

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

Changelog

Since 5.1.0 Introduced.

WP_Error::has_errors() code WP 6.9.1

public function has_errors() {
	if ( ! empty( $this->errors ) ) {
		return true;
	}
	return false;
}