Automattic\WooCommerce\Internal\Admin\Settings

Payments::set_country()publicWC 1.0

Set the business location country for the Payments settings.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$Payments = new Payments();
$Payments->set_country( $location ): bool;
$location(строка) (обязательный)
The country code. This should be a ISO 3166-1 alpha-2 country code.

Код Payments::set_country() WC 9.6.0

public function set_country( string $location ): bool {
	$user_payments_nox_profile = get_user_meta( get_current_user_id(), self::USER_PAYMENTS_NOX_PROFILE_KEY, true );

	if ( empty( $user_payments_nox_profile ) ) {
		$user_payments_nox_profile = array();
	} else {
		$user_payments_nox_profile = maybe_unserialize( $user_payments_nox_profile );
	}
	$user_payments_nox_profile['business_country_code'] = $location;

	return false !== update_user_meta( get_current_user_id(), self::USER_PAYMENTS_NOX_PROFILE_KEY, $user_payments_nox_profile );
}