Automattic\WooCommerce\Admin\Features\MarketingRecommendations

Init::evaluate_specs()protected staticWC 1.0

Process specs.

Method of the class: Init{}

No Hooks.

Return

Array.

Usage

$result = Init::evaluate_specs( $specs );
$specs(array|null)
Marketing recommendations spec array.
Default: null

Init::evaluate_specs() code WC 9.0.1

protected static function evaluate_specs( array $specs = null ) {
	$suggestions = array();
	$errors      = array();

	foreach ( $specs as $spec ) {
		try {
			$suggestions[] = self::object_to_array( $spec );
		} catch ( \Throwable $e ) {
			$errors[] = $e;
		}
	}

	return array(
		'suggestions' => $suggestions,
		'errors'      => $errors,
	);
}