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

Messages::get_formatted_messagespublicWC 1.0

Get all error messages, formatted as per the ACP spec.

Method of the class: Messages{}

No Hooks.

Returns

Array. that is ready for the response.

Usage

$Messages = new Messages();
$Messages->get_formatted_messages(): array;

Messages::get_formatted_messages() code WC 10.7.0

public function get_formatted_messages(): array {
	return array_map(
		function ( Message $message ) {
			return $message->to_array();
		},
		$this->messages
	);
}