WP_Error::has_errors()publicWP 5.1.0

Verifies if the instance contains errors.

Method of the class: WP_Error{}

No Hooks.

Return

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.5.2

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