Automattic\WooCommerce\Internal\Admin\Settings
PaymentsProviders::get_extension_suggestion_by_plugin_slug
Get a payment extension suggestion by plugin slug.
Метод класса: PaymentsProviders{}
Хуков нет.
Возвращает
?array. The payment extension suggestion details, or null if not found.
Использование
$PaymentsProviders = new PaymentsProviders(); $PaymentsProviders->get_extension_suggestion_by_plugin_slug( $slug, $country_code ): ?array;
- $slug(строка) (обязательный)
- The plugin slug of the payment extension suggestion.
- $country_code(строка)
- The business location country code to get the suggestions for.
По умолчанию:''
Код PaymentsProviders::get_extension_suggestion_by_plugin_slug() PaymentsProviders::get extension suggestion by plugin slug WC 11.1.0
public function get_extension_suggestion_by_plugin_slug( string $slug, string $country_code = '' ): ?array {
// Normalize the country code to uppercase.
$country_code = strtoupper( $country_code );
$suggestion = $this->extension_suggestions->get_by_plugin_slug( $slug, $country_code, Payments::SUGGESTIONS_CONTEXT );
if ( ! is_null( $suggestion ) ) {
// Enhance the suggestion details.
$suggestion = $this->enhance_extension_suggestion( $suggestion );
}
return $suggestion;
}