Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions
Init::get_cached_or_default_suggestions
Gets either cached or default suggestions.
Метод класса: Init{}
Хуки из метода
Возвращает
Массив.
Использование
$result = Init::get_cached_or_default_suggestions();
Код Init::get_cached_or_default_suggestions() Init::get cached or default suggestions WC 10.5.2
public static function get_cached_or_default_suggestions() {
$specs = 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' )
? DefaultPaymentGateways::get_all()
: PaymentGatewaySuggestionsDataSourcePoller::get_instance()->get_cached_specs();
if ( ! is_array( $specs ) || 0 === count( $specs ) ) {
$specs = DefaultPaymentGateways::get_all();
}
/**
* Allows filtering of payment gateway suggestion specs
*
* @since 6.4.0
*
* @param array Gateway specs.
*/
$specs = apply_filters( 'woocommerce_admin_payment_gateway_suggestion_specs', $specs );
$results = EvaluateSuggestion::evaluate_specs( $specs );
return $results['suggestions'];
}