PHP 클래스 WC_Countries

The WooCommerce countries class stores country/state data.
저자: WooThemes
파일 보기 프로젝트 열기: woocommerce/woocommerce 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$address_formats Array of address formats for locales
$locale Array of locales

공개 메소드들

메소드 설명
__get ( mixed $key ) : mixed Auto-load in-accessible properties on demand.
country_dropdown_options ( string $selected_country = '', string $selected_state = '', boolean $escape = false ) Outputs the list of countries and states for use in dropdown boxes.
estimated_for_prefix ( $country_code = '' ) : string Prefix certain countries with 'the'
ex_tax_or_vat ( ) : string Include the Ex Tax label.
get_address_fields ( mixed $country = '', string $type = 'billing_' ) : array Apply locale and get address fields.
get_address_formats ( ) : array Get country address formats.
get_allowed_countries ( ) : array Get the allowed countries for the store.
get_allowed_country_states ( ) : array Get allowed country states.
get_base_city ( ) : string Get the base city for the store.
get_base_country ( ) : string Get the base country for the store.
get_base_postcode ( ) : string Get the base postcode for the store.
get_base_state ( ) : string Get the base state for the store.
get_continent_code_for_country ( string $cc ) : string Get continent code for a country code.
get_continents ( ) : array Get all continents.
get_countries ( ) : array Get all countries.
get_country_locale ( ) : array Get country locale settings.
get_country_locale_field_selectors ( ) : array Get JS selectors for fields which are shown/hidden depending on the locale.
get_default_address_fields ( ) : array Returns the fields we show by default. This can be filtered later on.
get_european_union_countries ( $type = '' ) : string[] Gets an array of countries in the EU.
get_formatted_address ( array $args = [] ) : string Get country address format.
get_shipping_countries ( ) : array Get the countries you ship to.
get_shipping_country_states ( ) : array Get shipping country states.
get_states ( string $cc = null ) : array Get the states for a country.
inc_tax_or_vat ( ) : string Include the Inc Tax label.
load_country_states ( ) Load the states.
shipping_to_prefix ( $country_code = '' ) : string Gets the correct string for shipping - either 'to the' or 'to'
tax_or_vat ( ) : string Correctly name tax in some countries VAT on the frontend.

비공개 메소드들

메소드 설명
trim_formatted_address_line ( string $line ) : string Trim white space and commas off a line.

메소드 상세

__get() 공개 메소드

Auto-load in-accessible properties on demand.
public __get ( mixed $key ) : mixed
$key mixed
리턴 mixed

country_dropdown_options() 공개 메소드

Outputs the list of countries and states for use in dropdown boxes.
public country_dropdown_options ( string $selected_country = '', string $selected_state = '', boolean $escape = false )
$selected_country string (default: '')
$selected_state string (default: '')
$escape boolean (default: false)

estimated_for_prefix() 공개 메소드

Prefix certain countries with 'the'
public estimated_for_prefix ( $country_code = '' ) : string
리턴 string

ex_tax_or_vat() 공개 메소드

Include the Ex Tax label.
public ex_tax_or_vat ( ) : string
리턴 string

get_address_fields() 공개 메소드

Apply locale and get address fields.
public get_address_fields ( mixed $country = '', string $type = 'billing_' ) : array
$country mixed (default: '')
$type string (default: 'billing_')
리턴 array

get_address_formats() 공개 메소드

Get country address formats.
public get_address_formats ( ) : array
리턴 array

get_allowed_countries() 공개 메소드

Get the allowed countries for the store.
public get_allowed_countries ( ) : array
리턴 array

get_allowed_country_states() 공개 메소드

Get allowed country states.
public get_allowed_country_states ( ) : array
리턴 array

get_base_city() 공개 메소드

Get the base city for the store.
public get_base_city ( ) : string
리턴 string

get_base_country() 공개 메소드

Get the base country for the store.
public get_base_country ( ) : string
리턴 string

get_base_postcode() 공개 메소드

Get the base postcode for the store.
public get_base_postcode ( ) : string
리턴 string

get_base_state() 공개 메소드

Get the base state for the store.
public get_base_state ( ) : string
리턴 string

get_continent_code_for_country() 공개 메소드

Get continent code for a country code.
부터: 2.6.0
public get_continent_code_for_country ( string $cc ) : string
$cc string string
리턴 string

get_continents() 공개 메소드

Get all continents.
public get_continents ( ) : array
리턴 array

get_countries() 공개 메소드

Get all countries.
public get_countries ( ) : array
리턴 array

get_country_locale() 공개 메소드

Get country locale settings.
public get_country_locale ( ) : array
리턴 array

get_country_locale_field_selectors() 공개 메소드

Get JS selectors for fields which are shown/hidden depending on the locale.

get_default_address_fields() 공개 메소드

Returns the fields we show by default. This can be filtered later on.
public get_default_address_fields ( ) : array
리턴 array

get_european_union_countries() 공개 메소드

MC (monaco) and IM (isle of man, part of UK) also use VAT.
public get_european_union_countries ( $type = '' ) : string[]
$type Type of countries to retrieve. Blank for EU member countries. eu_vat for EU VAT countries.
리턴 string[]

get_formatted_address() 공개 메소드

Get country address format.
public get_formatted_address ( array $args = [] ) : string
$args array (default: array())
리턴 string address

get_shipping_countries() 공개 메소드

Get the countries you ship to.
public get_shipping_countries ( ) : array
리턴 array

get_shipping_country_states() 공개 메소드

Get shipping country states.

get_states() 공개 메소드

Get the states for a country.
public get_states ( string $cc = null ) : array
$cc string country code
리턴 array of states

inc_tax_or_vat() 공개 메소드

Include the Inc Tax label.
public inc_tax_or_vat ( ) : string
리턴 string

load_country_states() 공개 메소드

Load the states.
public load_country_states ( )

shipping_to_prefix() 공개 메소드

Gets the correct string for shipping - either 'to the' or 'to'
public shipping_to_prefix ( $country_code = '' ) : string
리턴 string

tax_or_vat() 공개 메소드

Correctly name tax in some countries VAT on the frontend.
public tax_or_vat ( ) : string
리턴 string

프로퍼티 상세

$address_formats 공개적으로 프로퍼티

Array of address formats for locales
public $address_formats

$locale 공개적으로 프로퍼티

Array of locales
public $locale