Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
Payments::get_payments_settings_country
Get the store's business registration country/location as it is used on the Payments Settings page.
Метод класса: Payments{}
Хуков нет.
Возвращает
string. The business registration country/location code.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_payments_settings_country(): string;
Код Payments::get_payments_settings_country() Payments::get payments settings country WC 11.3.0
private function get_payments_settings_country(): string {
try {
/**
* The Payments Settings [page] service.
*
* @var SettingsPaymentsService $settings_payments_service
*/
$settings_payments_service = wc_get_container()->get( SettingsPaymentsService::class );
return $settings_payments_service->get_country();
} catch ( \Throwable $e ) {
// In case of any error, return the WooCommerce base country.
return WC()->countries->get_base_country();
}
}