Automattic\WooCommerce\Internal\Admin\Settings

Payments::get_country()publicWC 1.0

Get the business location country code for the Payments settings.

Метод класса: Payments{}

Хуков нет.

Возвращает

Строку. The ISO 3166-1 alpha-2 country code to use for the overall business location. If the user didn't set a location, the WC base location country code is used.

Использование

$Payments = new Payments();
$Payments->get_country(): string;

Код Payments::get_country() WC 9.6.1

public function get_country(): string {
	$user_nox_meta = get_user_meta( get_current_user_id(), self::USER_PAYMENTS_NOX_PROFILE_KEY, true );
	if ( ! empty( $user_nox_meta['business_country_code'] ) ) {
		return $user_nox_meta['business_country_code'];
	}

	return WC()->countries->get_base_country();
}