Automattic\WooCommerce\Blueprint

StepProcessorResult::get_messagespublicWC 1.0

Filter messages.

Method of the class: StepProcessorResult{}

No Hooks.

Returns

Array.

Usage

$StepProcessorResult = new StepProcessorResult();
$StepProcessorResult->get_messages( $type ): array;
$type(string)
one of all, error, and info.
Default: 'all'

StepProcessorResult::get_messages() code WC 9.9.5

public function get_messages( string $type = 'all' ): array {
	if ( 'all' === $type ) {
		return $this->messages;
	}

	return array_filter(
		$this->messages,
		function ( $message ) use ( $type ) {
			return $type === $message['type'];
		}
	);
}