Automattic\WooCommerce\StoreApi\Routes\V1\Agentic\Messages

Messages::has_errorspublicWC 1.0

Check if there are any error messages.

Method of the class: Messages{}

No Hooks.

Returns

true|false. True if there are error messages, false otherwise.

Usage

$Messages = new Messages();
$Messages->has_errors(): bool;

Messages::has_errors() code WC 10.7.0

public function has_errors(): bool {
	foreach ( $this->messages as $message ) {
		if ( $message->is_error() ) {
			return true;
		}
	}
	return false;
}