Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

EvaluateSuggestion::evaluate()public staticWC 1.0

Evaluates the spec and returns the suggestion.

{} Это метод класса: EvaluateSuggestion{}

Хуков нет.

Возвращает

Объект. The evaluated suggestion.

Использование

$result = EvaluateSuggestion::evaluate( $spec );
$spec(объект|массив) (обязательный)
The suggestion to evaluate.

Код EvaluateSuggestion::evaluate() WC 6.9.4

public static function evaluate( $spec ) {
	$rule_evaluator = new RuleEvaluator();
	$suggestion     = is_array( $spec ) ? (object) $spec : clone $spec;

	if ( isset( $suggestion->is_visible ) ) {
		$is_visible             = $rule_evaluator->evaluate( $suggestion->is_visible );
		$suggestion->is_visible = $is_visible;
	}

	return $suggestion;
}