Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

Init::get_suggestions()public staticWC 1.0

Go through the specs and run them.

Метод класса: Init{}

No Hooks.

Return

Array.

Usage

$result = Init::get_suggestions( $specs );
$specs(array|null)
payment suggestion spec array.
Default: null

Code of Init::get_suggestions() WC 7.1.0

public static function get_suggestions( array $specs = null ) {
	$suggestions = array();
	if ( null === $specs ) {
		$specs = self::get_specs();
	}

	foreach ( $specs as $spec ) {
		$suggestion    = EvaluateSuggestion::evaluate( $spec );
		$suggestions[] = $suggestion;
	}

	return array_values(
		array_filter(
			$suggestions,
			function( $suggestion ) {
				return ! property_exists( $suggestion, 'is_visible' ) || $suggestion->is_visible;
			}
		)
	);

}