nabled_gateways ); } /** * Get the list of gateways to suggest. * * @param string $filter_by Filter by category. "category_additional" or "category_other". * * @return array */ private static function get_suggestion_gateways( $filter_by = 'category_additional' ) { $country = wc_get_base_location()['country']; $plugin_suggestions = Init::get_cached_or_default_suggestions(); $plugin_suggestions = array_filter( $plugin_suggestions, function( $plugin ) use ( $country, $filter_by ) { if ( ! isset( $plugin->{$filter_by} ) || ! isset( $plugin->plugins[0] ) ) { return false; } return in_array( $country, $plugin->{$filter_by}, true ); } ); return $plugin_suggestions; } }