Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions
Init::get_cached_or_default_suggestions()
Gets either cached or default suggestions.
Method of the class: Init{}
Hooks from the method
Return
Array
.
Usage
$result = Init::get_cached_or_default_suggestions();
Init::get_cached_or_default_suggestions() Init::get cached or default suggestions code WC 9.7.1
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']; }