country-functions.php ➔ give_get_states_list()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 73

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 73
rs 8.589
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * Country Functions
4
 *
5
 * @package     Give
6
 * @subpackage  Functions
7
 * @copyright   Copyright (c) 2016, GiveWP
8
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
9
 * @since       1.0
10
 */
11
12
// Exit if accessed directly.
13
if ( ! defined( 'ABSPATH' ) ) {
14
	exit;
15
}
16
17
/**
18
 * Get Site Base Country
19
 *
20
 * @since 1.0
21
 * @return string $country The two letter country code for the site's base country
22
 */
23
function give_get_country() {
24
	$give_options = give_get_settings();
25
	$country      = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US';
26
27
	return apply_filters( 'give_give_country', $country );
28
}
29
30
/**
31
 * Get Site Base State
32
 *
33
 * @since 1.0
34
 * @return string $state The site's base state name
35
 */
36
function give_get_state() {
37
	$give_options = give_get_settings();
38
	$state        = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false;
39
40
	return apply_filters( 'give_give_state', $state );
41
}
42
43
/**
44
 * Get Site States
45
 *
46
 * @since 1.0
47
 *
48
 * @param null $country
49
 *
50
 * @return mixed  A list of states for the site's base country.
51
 */
52
function give_get_states( $country = null ) {
53
	// If Country have no states return empty array.
54
	$states = array();
55
56
	// Check if Country Code is empty or not.
57
	if ( empty( $country ) ) {
58
		// Get default country code that is being set by the admin.
59
		$country = give_get_country();
60
	}
61
62
	// Get all the list of the states in array key format where key is the country code and value is the states that it contain.
63
	$states_list = give_states_list();
64
65
	// Check if $country code exists in the array key.
66
	if ( array_key_exists( $country, $states_list ) ) {
67
		$states = $states_list[ $country ];
68
	}
69
70
	/**
71
	 * Filter the query in case tables are non-standard.
72
	 *
73
	 * @param string $query Database count query
74
	 */
75
	return (array) apply_filters( 'give_give_states', $states );
76
}
77
78
/**
79
 * Get Country List
80
 *
81
 * @since 1.0
82
 * @return array $countries A list of the available countries.
83
 */
84
function give_get_country_list() {
85
	$countries = array(
86
		''   => '',
87
		'US' => esc_html__( 'United States', 'give' ),
88
		'CA' => esc_html__( 'Canada', 'give' ),
89
		'GB' => esc_html__( 'United Kingdom', 'give' ),
90
		'AF' => esc_html__( 'Afghanistan', 'give' ),
91
		'AL' => esc_html__( 'Albania', 'give' ),
92
		'DZ' => esc_html__( 'Algeria', 'give' ),
93
		'AS' => esc_html__( 'American Samoa', 'give' ),
94
		'AD' => esc_html__( 'Andorra', 'give' ),
95
		'AO' => esc_html__( 'Angola', 'give' ),
96
		'AI' => esc_html__( 'Anguilla', 'give' ),
97
		'AQ' => esc_html__( 'Antarctica', 'give' ),
98
		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
99
		'AR' => esc_html__( 'Argentina', 'give' ),
100
		'AM' => esc_html__( 'Armenia', 'give' ),
101
		'AW' => esc_html__( 'Aruba', 'give' ),
102
		'AU' => esc_html__( 'Australia', 'give' ),
103
		'AT' => esc_html__( 'Austria', 'give' ),
104
		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
105
		'BS' => esc_html__( 'Bahamas', 'give' ),
106
		'BH' => esc_html__( 'Bahrain', 'give' ),
107
		'BD' => esc_html__( 'Bangladesh', 'give' ),
108
		'BB' => esc_html__( 'Barbados', 'give' ),
109
		'BY' => esc_html__( 'Belarus', 'give' ),
110
		'BE' => esc_html__( 'Belgium', 'give' ),
111
		'BZ' => esc_html__( 'Belize', 'give' ),
112
		'BJ' => esc_html__( 'Benin', 'give' ),
113
		'BM' => esc_html__( 'Bermuda', 'give' ),
114
		'BT' => esc_html__( 'Bhutan', 'give' ),
115
		'BO' => esc_html__( 'Bolivia', 'give' ),
116
		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
117
		'BW' => esc_html__( 'Botswana', 'give' ),
118
		'BV' => esc_html__( 'Bouvet Island', 'give' ),
119
		'BR' => esc_html__( 'Brazil', 'give' ),
120
		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
121
		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
122
		'BG' => esc_html__( 'Bulgaria', 'give' ),
123
		'BF' => esc_html__( 'Burkina Faso', 'give' ),
124
		'BI' => esc_html__( 'Burundi', 'give' ),
125
		'KH' => esc_html__( 'Cambodia', 'give' ),
126
		'CM' => esc_html__( 'Cameroon', 'give' ),
127
		'CV' => esc_html__( 'Cape Verde', 'give' ),
128
		'KY' => esc_html__( 'Cayman Islands', 'give' ),
129
		'CF' => esc_html__( 'Central African Republic', 'give' ),
130
		'TD' => esc_html__( 'Chad', 'give' ),
131
		'CL' => esc_html__( 'Chile', 'give' ),
132
		'CN' => esc_html__( 'China', 'give' ),
133
		'CX' => esc_html__( 'Christmas Island', 'give' ),
134
		'CC' => esc_html__( 'Cocos Islands', 'give' ),
135
		'CO' => esc_html__( 'Colombia', 'give' ),
136
		'KM' => esc_html__( 'Comoros', 'give' ),
137
		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
138
		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
139
		'CK' => esc_html__( 'Cook Islands', 'give' ),
140
		'CR' => esc_html__( 'Costa Rica', 'give' ),
141
		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
142
		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
143
		'CU' => esc_html__( 'Cuba', 'give' ),
144
		'CY' => esc_html__( 'Cyprus Island', 'give' ),
145
		'CZ' => esc_html__( 'Czech Republic', 'give' ),
146
		'DK' => esc_html__( 'Denmark', 'give' ),
147
		'DJ' => esc_html__( 'Djibouti', 'give' ),
148
		'DM' => esc_html__( 'Dominica', 'give' ),
149
		'DO' => esc_html__( 'Dominican Republic', 'give' ),
150
		'TP' => esc_html__( 'East Timor', 'give' ),
151
		'EC' => esc_html__( 'Ecuador', 'give' ),
152
		'EG' => esc_html__( 'Egypt', 'give' ),
153
		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
154
		'SV' => esc_html__( 'El Salvador', 'give' ),
155
		'ER' => esc_html__( 'Eritrea', 'give' ),
156
		'EE' => esc_html__( 'Estonia', 'give' ),
157
		'ET' => esc_html__( 'Ethiopia', 'give' ),
158
		'FK' => esc_html__( 'Falkland Islands', 'give' ),
159
		'FO' => esc_html__( 'Faroe Islands', 'give' ),
160
		'FJ' => esc_html__( 'Fiji', 'give' ),
161
		'FI' => esc_html__( 'Finland', 'give' ),
162
		'FR' => esc_html__( 'France', 'give' ),
163
		'GF' => esc_html__( 'French Guiana', 'give' ),
164
		'PF' => esc_html__( 'French Polynesia', 'give' ),
165
		'TF' => esc_html__( 'French Southern Territories', 'give' ),
166
		'GA' => esc_html__( 'Gabon', 'give' ),
167
		'GM' => esc_html__( 'Gambia', 'give' ),
168
		'GE' => esc_html__( 'Georgia', 'give' ),
169
		'DE' => esc_html__( 'Germany', 'give' ),
170
		'GR' => esc_html__( 'Greece', 'give' ),
171
		'GH' => esc_html__( 'Ghana', 'give' ),
172
		'GI' => esc_html__( 'Gibraltar', 'give' ),
173
		'GL' => esc_html__( 'Greenland', 'give' ),
174
		'GD' => esc_html__( 'Grenada', 'give' ),
175
		'GP' => esc_html__( 'Guadeloupe', 'give' ),
176
		'GU' => esc_html__( 'Guam', 'give' ),
177
		'GT' => esc_html__( 'Guatemala', 'give' ),
178
		'GG' => esc_html__( 'Guernsey', 'give' ),
179
		'GN' => esc_html__( 'Guinea', 'give' ),
180
		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
181
		'GY' => esc_html__( 'Guyana', 'give' ),
182
		'HT' => esc_html__( 'Haiti', 'give' ),
183
		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
184
		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
185
		'HN' => esc_html__( 'Honduras', 'give' ),
186
		'HK' => esc_html__( 'Hong Kong', 'give' ),
187
		'HU' => esc_html__( 'Hungary', 'give' ),
188
		'IS' => esc_html__( 'Iceland', 'give' ),
189
		'IN' => esc_html__( 'India', 'give' ),
190
		'ID' => esc_html__( 'Indonesia', 'give' ),
191
		'IR' => esc_html__( 'Iran', 'give' ),
192
		'IQ' => esc_html__( 'Iraq', 'give' ),
193
		'IE' => esc_html__( 'Ireland', 'give' ),
194
		'IM' => esc_html__( 'Isle of Man', 'give' ),
195
		'IL' => esc_html__( 'Israel', 'give' ),
196
		'IT' => esc_html__( 'Italy', 'give' ),
197
		'JM' => esc_html__( 'Jamaica', 'give' ),
198
		'JP' => esc_html__( 'Japan', 'give' ),
199
		'JE' => esc_html__( 'Jersey', 'give' ),
200
		'JO' => esc_html__( 'Jordan', 'give' ),
201
		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
202
		'KE' => esc_html__( 'Kenya', 'give' ),
203
		'KI' => esc_html__( 'Kiribati', 'give' ),
204
		'KW' => esc_html__( 'Kuwait', 'give' ),
205
		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
206
		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
207
		'LV' => esc_html__( 'Latvia', 'give' ),
208
		'LB' => esc_html__( 'Lebanon', 'give' ),
209
		'LS' => esc_html__( 'Lesotho', 'give' ),
210
		'LR' => esc_html__( 'Liberia', 'give' ),
211
		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
212
		'LI' => esc_html__( 'Liechtenstein', 'give' ),
213
		'LT' => esc_html__( 'Lithuania', 'give' ),
214
		'LU' => esc_html__( 'Luxembourg', 'give' ),
215
		'MO' => esc_html__( 'Macau', 'give' ),
216
		'MK' => esc_html__( 'Macedonia', 'give' ),
217
		'MG' => esc_html__( 'Madagascar', 'give' ),
218
		'MW' => esc_html__( 'Malawi', 'give' ),
219
		'MY' => esc_html__( 'Malaysia', 'give' ),
220
		'MV' => esc_html__( 'Maldives', 'give' ),
221
		'ML' => esc_html__( 'Mali', 'give' ),
222
		'MT' => esc_html__( 'Malta', 'give' ),
223
		'MH' => esc_html__( 'Marshall Islands', 'give' ),
224
		'MQ' => esc_html__( 'Martinique', 'give' ),
225
		'MR' => esc_html__( 'Mauritania', 'give' ),
226
		'MU' => esc_html__( 'Mauritius', 'give' ),
227
		'YT' => esc_html__( 'Mayotte', 'give' ),
228
		'MX' => esc_html__( 'Mexico', 'give' ),
229
		'FM' => esc_html__( 'Micronesia', 'give' ),
230
		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
231
		'MC' => esc_html__( 'Monaco', 'give' ),
232
		'MN' => esc_html__( 'Mongolia', 'give' ),
233
		'ME' => esc_html__( 'Montenegro', 'give' ),
234
		'MS' => esc_html__( 'Montserrat', 'give' ),
235
		'MA' => esc_html__( 'Morocco', 'give' ),
236
		'MZ' => esc_html__( 'Mozambique', 'give' ),
237
		'MM' => esc_html__( 'Myanmar', 'give' ),
238
		'NA' => esc_html__( 'Namibia', 'give' ),
239
		'NR' => esc_html__( 'Nauru', 'give' ),
240
		'NP' => esc_html__( 'Nepal', 'give' ),
241
		'NL' => esc_html__( 'Netherlands', 'give' ),
242
		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
243
		'NC' => esc_html__( 'New Caledonia', 'give' ),
244
		'NZ' => esc_html__( 'New Zealand', 'give' ),
245
		'NI' => esc_html__( 'Nicaragua', 'give' ),
246
		'NE' => esc_html__( 'Niger', 'give' ),
247
		'NG' => esc_html__( 'Nigeria', 'give' ),
248
		'NU' => esc_html__( 'Niue', 'give' ),
249
		'NF' => esc_html__( 'Norfolk Island', 'give' ),
250
		'KP' => esc_html__( 'North Korea', 'give' ),
251
		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
252
		'NO' => esc_html__( 'Norway', 'give' ),
253
		'OM' => esc_html__( 'Oman', 'give' ),
254
		'PK' => esc_html__( 'Pakistan', 'give' ),
255
		'PW' => esc_html__( 'Palau', 'give' ),
256
		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
257
		'PA' => esc_html__( 'Panama', 'give' ),
258
		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
259
		'PY' => esc_html__( 'Paraguay', 'give' ),
260
		'PE' => esc_html__( 'Peru', 'give' ),
261
		'PH' => esc_html__( 'Philippines', 'give' ),
262
		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
263
		'PL' => esc_html__( 'Poland', 'give' ),
264
		'PT' => esc_html__( 'Portugal', 'give' ),
265
		'PR' => esc_html__( 'Puerto Rico', 'give' ),
266
		'QA' => esc_html__( 'Qatar', 'give' ),
267
		'RE' => esc_html__( 'Reunion Island', 'give' ),
268
		'RO' => esc_html__( 'Romania', 'give' ),
269
		'RU' => esc_html__( 'Russian Federation', 'give' ),
270
		'RW' => esc_html__( 'Rwanda', 'give' ),
271
		'SH' => esc_html__( 'Saint Helena', 'give' ),
272
		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
273
		'LC' => esc_html__( 'Saint Lucia', 'give' ),
274
		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
275
		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
276
		'SM' => esc_html__( 'San Marino', 'give' ),
277
		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
278
		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
279
		'SN' => esc_html__( 'Senegal', 'give' ),
280
		'RS' => esc_html__( 'Serbia', 'give' ),
281
		'SC' => esc_html__( 'Seychelles', 'give' ),
282
		'SL' => esc_html__( 'Sierra Leone', 'give' ),
283
		'SG' => esc_html__( 'Singapore', 'give' ),
284
		'SK' => esc_html__( 'Slovak Republic', 'give' ),
285
		'SI' => esc_html__( 'Slovenia', 'give' ),
286
		'SB' => esc_html__( 'Solomon Islands', 'give' ),
287
		'SO' => esc_html__( 'Somalia', 'give' ),
288
		'ZA' => esc_html__( 'South Africa', 'give' ),
289
		'GS' => esc_html__( 'South Georgia', 'give' ),
290
		'KR' => esc_html__( 'South Korea', 'give' ),
291
		'ES' => esc_html__( 'Spain', 'give' ),
292
		'LK' => esc_html__( 'Sri Lanka', 'give' ),
293
		'SD' => esc_html__( 'Sudan', 'give' ),
294
		'SR' => esc_html__( 'Suriname', 'give' ),
295
		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
296
		'SZ' => esc_html__( 'Eswatini', 'give' ),
297
		'SE' => esc_html__( 'Sweden', 'give' ),
298
		'CH' => esc_html__( 'Switzerland', 'give' ),
299
		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
300
		'TW' => esc_html__( 'Taiwan', 'give' ),
301
		'TJ' => esc_html__( 'Tajikistan', 'give' ),
302
		'TZ' => esc_html__( 'Tanzania', 'give' ),
303
		'TG' => esc_html__( 'Togo', 'give' ),
304
		'TK' => esc_html__( 'Tokelau', 'give' ),
305
		'TO' => esc_html__( 'Tonga', 'give' ),
306
		'TH' => esc_html__( 'Thailand', 'give' ),
307
		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
308
		'TN' => esc_html__( 'Tunisia', 'give' ),
309
		'TR' => esc_html__( 'Turkey', 'give' ),
310
		'TM' => esc_html__( 'Turkmenistan', 'give' ),
311
		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
312
		'TV' => esc_html__( 'Tuvalu', 'give' ),
313
		'UG' => esc_html__( 'Uganda', 'give' ),
314
		'UA' => esc_html__( 'Ukraine', 'give' ),
315
		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
316
		'UY' => esc_html__( 'Uruguay', 'give' ),
317
		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
318
		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
319
		'VU' => esc_html__( 'Vanuatu', 'give' ),
320
		'VE' => esc_html__( 'Venezuela', 'give' ),
321
		'VN' => esc_html__( 'Vietnam', 'give' ),
322
		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
323
		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
324
		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
325
		'EH' => esc_html__( 'Western Sahara', 'give' ),
326
		'WS' => esc_html__( 'Western Samoa', 'give' ),
327
		'YE' => esc_html__( 'Yemen', 'give' ),
328
		'YU' => esc_html__( 'Yugoslavia', 'give' ),
329
		'ZM' => esc_html__( 'Zambia', 'give' ),
330
		'ZW' => esc_html__( 'Zimbabwe', 'give' ),
331
	);
332
333
	return (array) apply_filters( 'give_countries', $countries );
334
}
335
336
/**
337
 * Get States List.
338
 *
339
 * @since 1.8.11
340
 *
341
 * @return array $states A list of the available states as in array key format.
342
 */
343
function give_states_list() {
344
	$states = array(
345
		'US' => give_get_states_list(),
346
		'CA' => give_get_provinces_list(),
347
		'AU' => give_get_australian_states_list(),
348
		'BR' => give_get_brazil_states_list(),
349
		'CN' => give_get_chinese_states_list(),
350
		'HK' => give_get_hong_kong_states_list(),
351
		'HU' => give_get_hungary_states_list(),
352
		'ID' => give_get_indonesian_states_list(),
353
		'IN' => give_get_indian_states_list(),
354
		'MY' => give_get_malaysian_states_list(),
355
		'NZ' => give_get_new_zealand_states_list(),
356
		'TH' => give_get_thailand_states_list(),
357
		'ZA' => give_get_south_african_states_list(),
358
		'ES' => give_get_spain_states_list(),
359
		'TR' => give_get_turkey_states_list(),
360
		'RO' => give_get_romania_states_list(),
361
		'PK' => give_get_pakistan_states_list(),
362
		'PH' => give_get_philippines_states_list(),
363
		'PE' => give_get_peru_states_list(),
364
		'NP' => give_get_nepal_states_list(),
365
		'NG' => give_get_nigerian_states_list(),
366
		'MX' => give_get_mexico_states_list(),
367
		'JP' => give_get_japan_states_list(),
368
		'IT' => give_get_italy_states_list(),
369
		'IR' => give_get_iran_states_list(),
370
		'IE' => give_get_ireland_states_list(),
371
		'GR' => give_get_greek_states_list(),
372
		'BO' => give_get_bolivian_states_list(),
373
		'BG' => give_get_bulgarian_states_list(),
374
		'BD' => give_get_bangladeshi_states_list(),
375
		'AR' => give_get_argentina_states_list(),
376
	);
377
378
	/**
379
	 * Filter can be used to add or remove the States from the Country.
380
	 *
381
	 * Filters can be use to add states inside the country all the states will be in array format ans the array key will be country code.
382
	 *
383
	 * @since 1.8.11
384
	 *
385
	 * @param array $states Contain the list of states in array key format where key of the array is there respected country code.
386
	 */
387
	return (array) apply_filters( 'give_states_list', $states );
388
}
389
390
/**
391
 * List of Country that have no states init.
392
 *
393
 * There are some country which does not have states init Example: germany.
394
 *
395
 * @since 1.8.11
396
 *
397
 * $$country array $country_code.
398
 */
399 View Code Duplication
function give_no_states_country_list() {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
400
	$country_list = array();
401
	$locale       = give_get_country_locale();
402
	foreach ( $locale as $key => $value ) {
403
		if ( ! empty( $value['state'] ) && isset( $value['state']['hidden'] ) && true === $value['state']['hidden'] ) {
404
			$country_list[ $key ] = $value['state'];
405
		}
406
	}
407
408
	/**
409
	 * Filter can be used to add or remove the Country that does not have states init.
410
	 *
411
	 * @since 1.8.11
412
	 *
413
	 * @param array $country Contain key as there country code & value as there country name.
414
	 */
415
	return (array) apply_filters( 'give_no_states_country_list', $country_list );
416
}
417
418
/**
419
 * List of Country in which states fields is not required.
420
 *
421
 * There are some country in which states fields is not required Example: United Kingdom ( uk ).
422
 *
423
 * @since 1.8.11
424
 *
425
 * $country array $country_code.
426
 */
427 View Code Duplication
function give_states_not_required_country_list() {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
428
	$country_list = array();
429
	$locale       = give_get_country_locale();
430
	foreach ( $locale as $key => $value ) {
431
		if ( ! empty( $value['state'] ) && isset( $value['state']['required'] ) && false === $value['state']['required'] ) {
432
			$country_list[ $key ] = $value['state'];
433
		}
434
	}
435
436
	/**
437
	 * Filter can be used to add or remove the Country in which states fields is not required.
438
	 *
439
	 * @since 1.8.11
440
	 *
441
	 * @param array $country Contain key as there country code & value as there country name.
442
	 */
443
	return (array) apply_filters( 'give_states_not_required_country_list', $country_list );
444
}
445
446
/**
447
 * List of Country in which city fields is not required.
448
 *
449
 * There are some country in which city fields is not required Example: Singapore ( sk ).
450
 *
451
 * @since 2.3.0
452
 *
453
 * $country array $country_list.
454
 */
455 View Code Duplication
function give_city_not_required_country_list() {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
456
	$country_list = array();
457
	$locale       = give_get_country_locale();
458
	foreach ( $locale as $key => $value ) {
459
		if ( ! empty( $value['city'] ) && isset( $value['city']['required'] ) && false === $value['city']['required'] ) {
460
			$country_list[ $key ] = $value['city'];
461
		}
462
	}
463
464
	/**
465
	 * Filter can be used to add or remove the Country in which city fields is not required.
466
	 *
467
	 * @since 2.3.0
468
	 *
469
	 * @param array $country_list Contain key as there country code & value as there country name.
470
	 */
471
	return (array) apply_filters( 'give_city_not_required_country_list', $country_list );
472
}
473
474
/**
475
 * Get the country name by list key.
476
 *
477
 * @since 1.8.12
478
 *
479
 * @param string $key
480
 *
481
 * @return string|bool
482
 */
483
function give_get_country_name_by_key( $key ) {
484
	$country_list = give_get_country_list();
485
486
	if ( array_key_exists( $key, $country_list ) ) {
487
		return $country_list[ $key ];
488
	}
489
490
	return false;
491
}
492
493
/**
494
 * Get the label that need to show as an placeholder.
495
 *
496
 * @ since 1.8.12
497
 *
498
 * @return array $country_states_label
499
 */
500
function give_get_states_label() {
501
	$country_states_label = array();
502
	$default_label        = __( 'State', 'give' );
503
	$locale               = give_get_country_locale();
504
	foreach ( $locale as $key => $value ) {
505
		$label = $default_label;
506
		if ( ! empty( $value['state'] ) && ! empty( $value['state']['label'] ) ) {
507
			$label = $value['state']['label'];
508
		}
509
		$country_states_label[ $key ] = $label;
510
	}
511
512
	/**
513
	 * Filter can be used to add or remove the Country that does not have states init.
514
	 *
515
	 * @since 1.8.11
516
	 *
517
	 * @param array $country Contain key as there country code & value as there country name.
518
	 */
519
	return (array) apply_filters( 'give_get_states_label', $country_states_label );
520
}
521
522
/**
523
 * Get country locale settings.
524
 *
525
 * @since 1.8.12
526
 *
527
 * @return array
528
 */
529
function give_get_country_locale() {
530
	return (array) apply_filters( 'give_get_country_locale', array(
531
		'AE' => array(
532
			'state' => array(
533
				'required' => false,
534
			),
535
		),
536
		'AF' => array(
537
			'state' => array(
538
				'required' => false,
539
				'hidden'   => true,
540
			),
541
		),
542
		'AT' => array(
543
			'state' => array(
544
				'required' => false,
545
				'hidden'   => true,
546
			),
547
		),
548
		'AU' => array(
549
			'state' => array(
550
				'label' => __( 'State', 'give' ),
551
			),
552
		),
553
		'AX' => array(
554
			'state' => array(
555
				'required' => false,
556
			),
557
		),
558
		'BD' => array(
559
			'state' => array(
560
				'label' => __( 'District', 'give' ),
561
			),
562
		),
563
		'BE' => array(
564
			'state' => array(
565
				'required' => false,
566
				'label'    => __( 'Province', 'give' ),
567
				'hidden'   => true,
568
			),
569
		),
570
		'BI' => array(
571
			'state' => array(
572
				'required' => false,
573
			),
574
		),
575
		'CA' => array(
576
			'state' => array(
577
				'label' => __( 'Province', 'give' ),
578
			),
579
		),
580
		'CH' => array(
581
			'state' => array(
582
				'label'    => __( 'Canton', 'give' ),
583
				'required' => false,
584
				'hidden'   => true,
585
			),
586
		),
587
		'CL' => array(
588
			'state' => array(
589
				'label' => __( 'Region', 'give' ),
590
			),
591
		),
592
		'CN' => array(
593
			'state' => array(
594
				'label' => __( 'Province', 'give' ),
595
			),
596
		),
597
		'CZ' => array(
598
			'state' => array(
599
				'required' => false,
600
				'hidden'   => true,
601
			),
602
		),
603
		'DE' => array(
604
			'state' => array(
605
				'required' => false,
606
				'hidden'   => true,
607
			),
608
		),
609
		'DK' => array(
610
			'state' => array(
611
				'required' => false,
612
				'hidden'   => true,
613
			),
614
		),
615
		'EE' => array(
616
			'state' => array(
617
				'required' => false,
618
				'hidden'   => true,
619
			),
620
		),
621
		'FI' => array(
622
			'state' => array(
623
				'required' => false,
624
				'hidden'   => true,
625
			),
626
		),
627
		'FR' => array(
628
			'state' => array(
629
				'required' => false,
630
				'hidden'   => true,
631
			),
632
		),
633
		'GP' => array(
634
			'state' => array(
635
				'required' => false,
636
			),
637
		),
638
		'GF' => array(
639
			'state' => array(
640
				'required' => false,
641
			),
642
		),
643
		'HK' => array(
644
			'state' => array(
645
				'label' => __( 'Region', 'give' ),
646
			),
647
		),
648
		'HU' => array(
649
			'state' => array(
650
				'label'  => __( 'County', 'give' ),
651
				'hidden' => true,
652
			),
653
		),
654
		'ID' => array(
655
			'state' => array(
656
				'label' => __( 'Province', 'give' ),
657
			),
658
		),
659
		'IE' => array(
660
			'state' => array(
661
				'label' => __( 'County', 'give' ),
662
			),
663
		),
664
		'IS' => array(
665
			'state' => array(
666
				'required' => false,
667
				'hidden'   => true,
668
			),
669
		),
670
		'IL' => array(
671
			'state' => array(
672
				'required' => false,
673
			),
674
		),
675
		'IT' => array(
676
			'state' => array(
677
				'required' => true,
678
				'label'    => __( 'Province', 'give' ),
679
			),
680
		),
681
		'JP' => array(
682
			'state' => array(
683
				'label' => __( 'Prefecture', 'give' ),
684
			),
685
		),
686
		'KR' => array(
687
			'state' => array(
688
				'required' => false,
689
			),
690
		),
691
		'KW' => array(
692
			'state' => array(
693
				'required' => false,
694
			),
695
		),
696
		'LB' => array(
697
			'state' => array(
698
				'required' => false,
699
			),
700
		),
701
		'MQ' => array(
702
			'state' => array(
703
				'required' => false,
704
			),
705
		),
706
		'NL' => array(
707
			'state' => array(
708
				'required' => false,
709
				'label'    => __( 'Province', 'give' ),
710
				'hidden'   => true,
711
			),
712
		),
713
		'NZ' => array(
714
			'state' => array(
715
				'label' => __( 'Region', 'give' ),
716
			),
717
		),
718
		'NO' => array(
719
			'state' => array(
720
				'required' => false,
721
				'hidden'   => true,
722
			),
723
		),
724
		'NP' => array(
725
			'state' => array(
726
				'label' => __( 'State / Zone', 'give' ),
727
			),
728
		),
729
		'PL' => array(
730
			'state' => array(
731
				'required' => false,
732
				'hidden'   => true,
733
			),
734
		),
735
		'PT' => array(
736
			'state' => array(
737
				'required' => false,
738
				'hidden'   => true,
739
			),
740
		),
741
		'RE' => array(
742
			'state' => array(
743
				'required' => false,
744
			),
745
		),
746
		'RO' => array(
747
			'state' => array(
748
				'required' => false,
749
			),
750
		),
751
		'SG' => array(
752
			'state' => array(
753
				'required' => false,
754
			),
755
			'city'  => array(
756
				'required' => false,
757
			)
758
		),
759
		'SK' => array(
760
			'state' => array(
761
				'required' => false,
762
				'hidden'   => true,
763
			),
764
		),
765
		'SI' => array(
766
			'state' => array(
767
				'required' => false,
768
				'hidden'   => true,
769
			),
770
		),
771
		'ES' => array(
772
			'state' => array(
773
				'label' => __( 'Province', 'give' ),
774
			),
775
		),
776
		'LI' => array(
777
			'state' => array(
778
				'label'    => __( 'Municipality', 'give' ),
779
				'required' => false,
780
				'hidden'   => true,
781
			),
782
		),
783
		'LK' => array(
784
			'state' => array(
785
				'required' => false,
786
			),
787
		),
788
		'SE' => array(
789
			'state' => array(
790
				'required' => false,
791
				'hidden'   => true,
792
			),
793
		),
794
		'TR' => array(
795
			'state' => array(
796
				'label' => __( 'Province', 'give' ),
797
			),
798
		),
799
		'US' => array(
800
			'state' => array(
801
				'label' => __( 'State', 'give' ),
802
			),
803
		),
804
		'GB' => array(
805
			'state' => array(
806
				'label'    => __( 'County', 'give' ),
807
				'required' => false,
808
			),
809
		),
810
		'VN' => array(
811
			'state' => array(
812
				'required' => false,
813
				'hidden'   => true,
814
			),
815
		),
816
		'YT' => array(
817
			'state' => array(
818
				'required' => false,
819
			),
820
		),
821
		'ZA' => array(
822
			'state' => array(
823
				'label' => __( 'Province', 'give' ),
824
			),
825
		),
826
		'PA' => array(
827
			'state' => array(
828
				'required' => true,
829
			),
830
		),
831
	) );
832
}
833
834
/**
835
 * Get Turkey States
836
 *
837
 * @since 1.8.12
838
 * @return array $states A list of states
839
 */
840
function give_get_turkey_states_list() {
841
	$states = array(
842
		''     => '',
843
		'TR01' => __( 'Adana', 'give' ),
844
		'TR02' => __( 'Ad&#305;yaman', 'give' ),
845
		'TR03' => __( 'Afyon', 'give' ),
846
		'TR04' => __( 'A&#287;r&#305;', 'give' ),
847
		'TR05' => __( 'Amasya', 'give' ),
848
		'TR06' => __( 'Ankara', 'give' ),
849
		'TR07' => __( 'Antalya', 'give' ),
850
		'TR08' => __( 'Artvin', 'give' ),
851
		'TR09' => __( 'Ayd&#305;n', 'give' ),
852
		'TR10' => __( 'Bal&#305;kesir', 'give' ),
853
		'TR11' => __( 'Bilecik', 'give' ),
854
		'TR12' => __( 'Bing&#246;l', 'give' ),
855
		'TR13' => __( 'Bitlis', 'give' ),
856
		'TR14' => __( 'Bolu', 'give' ),
857
		'TR15' => __( 'Burdur', 'give' ),
858
		'TR16' => __( 'Bursa', 'give' ),
859
		'TR17' => __( '&#199;anakkale', 'give' ),
860
		'TR18' => __( '&#199;ank&#305;r&#305;', 'give' ),
861
		'TR19' => __( '&#199;orum', 'give' ),
862
		'TR20' => __( 'Denizli', 'give' ),
863
		'TR21' => __( 'Diyarbak&#305;r', 'give' ),
864
		'TR22' => __( 'Edirne', 'give' ),
865
		'TR23' => __( 'Elaz&#305;&#287;', 'give' ),
866
		'TR24' => __( 'Erzincan', 'give' ),
867
		'TR25' => __( 'Erzurum', 'give' ),
868
		'TR26' => __( 'Eski&#351;ehir', 'give' ),
869
		'TR27' => __( 'Gaziantep', 'give' ),
870
		'TR28' => __( 'Giresun', 'give' ),
871
		'TR29' => __( 'G&#252;m&#252;&#351;hane', 'give' ),
872
		'TR30' => __( 'Hakkari', 'give' ),
873
		'TR31' => __( 'Hatay', 'give' ),
874
		'TR32' => __( 'Isparta', 'give' ),
875
		'TR33' => __( '&#304;&#231;el', 'give' ),
876
		'TR34' => __( '&#304;stanbul', 'give' ),
877
		'TR35' => __( '&#304;zmir', 'give' ),
878
		'TR36' => __( 'Kars', 'give' ),
879
		'TR37' => __( 'Kastamonu', 'give' ),
880
		'TR38' => __( 'Kayseri', 'give' ),
881
		'TR39' => __( 'K&#305;rklareli', 'give' ),
882
		'TR40' => __( 'K&#305;r&#351;ehir', 'give' ),
883
		'TR41' => __( 'Kocaeli', 'give' ),
884
		'TR42' => __( 'Konya', 'give' ),
885
		'TR43' => __( 'K&#252;tahya', 'give' ),
886
		'TR44' => __( 'Malatya', 'give' ),
887
		'TR45' => __( 'Manisa', 'give' ),
888
		'TR46' => __( 'Kahramanmara&#351;', 'give' ),
889
		'TR47' => __( 'Mardin', 'give' ),
890
		'TR48' => __( 'Mu&#287;la', 'give' ),
891
		'TR49' => __( 'Mu&#351;', 'give' ),
892
		'TR50' => __( 'Nev&#351;ehir', 'give' ),
893
		'TR51' => __( 'Ni&#287;de', 'give' ),
894
		'TR52' => __( 'Ordu', 'give' ),
895
		'TR53' => __( 'Rize', 'give' ),
896
		'TR54' => __( 'Sakarya', 'give' ),
897
		'TR55' => __( 'Samsun', 'give' ),
898
		'TR56' => __( 'Siirt', 'give' ),
899
		'TR57' => __( 'Sinop', 'give' ),
900
		'TR58' => __( 'Sivas', 'give' ),
901
		'TR59' => __( 'Tekirda&#287;', 'give' ),
902
		'TR60' => __( 'Tokat', 'give' ),
903
		'TR61' => __( 'Trabzon', 'give' ),
904
		'TR62' => __( 'Tunceli', 'give' ),
905
		'TR63' => __( '&#350;anl&#305;urfa', 'give' ),
906
		'TR64' => __( 'U&#351;ak', 'give' ),
907
		'TR65' => __( 'Van', 'give' ),
908
		'TR66' => __( 'Yozgat', 'give' ),
909
		'TR67' => __( 'Zonguldak', 'give' ),
910
		'TR68' => __( 'Aksaray', 'give' ),
911
		'TR69' => __( 'Bayburt', 'give' ),
912
		'TR70' => __( 'Karaman', 'give' ),
913
		'TR71' => __( 'K&#305;r&#305;kkale', 'give' ),
914
		'TR72' => __( 'Batman', 'give' ),
915
		'TR73' => __( '&#350;&#305;rnak', 'give' ),
916
		'TR74' => __( 'Bart&#305;n', 'give' ),
917
		'TR75' => __( 'Ardahan', 'give' ),
918
		'TR76' => __( 'I&#287;d&#305;r', 'give' ),
919
		'TR77' => __( 'Yalova', 'give' ),
920
		'TR78' => __( 'Karab&#252;k', 'give' ),
921
		'TR79' => __( 'Kilis', 'give' ),
922
		'TR80' => __( 'Osmaniye', 'give' ),
923
		'TR81' => __( 'D&#252;zce', 'give' ),
924
	);
925
926
	return apply_filters( 'give_turkey_states', $states );
927
}
928
929
/**
930
 * Get Romania States
931
 *
932
 * @since 1.8.12
933
 * @return array $states A list of states
934
 */
935
function give_get_romania_states_list() {
936
	$states = array(
937
		''   => '',
938
		'AB' => __( 'Alba', 'give' ),
939
		'AR' => __( 'Arad', 'give' ),
940
		'AG' => __( 'Arges', 'give' ),
941
		'BC' => __( 'Bacau', 'give' ),
942
		'BH' => __( 'Bihor', 'give' ),
943
		'BN' => __( 'Bistrita-Nasaud', 'give' ),
944
		'BT' => __( 'Botosani', 'give' ),
945
		'BR' => __( 'Braila', 'give' ),
946
		'BV' => __( 'Brasov', 'give' ),
947
		'B'  => __( 'Bucuresti', 'give' ),
948
		'BZ' => __( 'Buzau', 'give' ),
949
		'CL' => __( 'Calarasi', 'give' ),
950
		'CS' => __( 'Caras-Severin', 'give' ),
951
		'CJ' => __( 'Cluj', 'give' ),
952
		'CT' => __( 'Constanta', 'give' ),
953
		'CV' => __( 'Covasna', 'give' ),
954
		'DB' => __( 'Dambovita', 'give' ),
955
		'DJ' => __( 'Dolj', 'give' ),
956
		'GL' => __( 'Galati', 'give' ),
957
		'GR' => __( 'Giurgiu', 'give' ),
958
		'GJ' => __( 'Gorj', 'give' ),
959
		'HR' => __( 'Harghita', 'give' ),
960
		'HD' => __( 'Hunedoara', 'give' ),
961
		'IL' => __( 'Ialomita', 'give' ),
962
		'IS' => __( 'Iasi', 'give' ),
963
		'IF' => __( 'Ilfov', 'give' ),
964
		'MM' => __( 'Maramures', 'give' ),
965
		'MH' => __( 'Mehedinti', 'give' ),
966
		'MS' => __( 'Mures', 'give' ),
967
		'NT' => __( 'Neamt', 'give' ),
968
		'OT' => __( 'Olt', 'give' ),
969
		'PH' => __( 'Prahova', 'give' ),
970
		'SJ' => __( 'Salaj', 'give' ),
971
		'SM' => __( 'Satu Mare', 'give' ),
972
		'SB' => __( 'Sibiu', 'give' ),
973
		'SV' => __( 'Suceava', 'give' ),
974
		'TR' => __( 'Teleorman', 'give' ),
975
		'TM' => __( 'Timis', 'give' ),
976
		'TL' => __( 'Tulcea', 'give' ),
977
		'VL' => __( 'Valcea', 'give' ),
978
		'VS' => __( 'Vaslui', 'give' ),
979
		'VN' => __( 'Vrancea', 'give' ),
980
	);
981
982
	return apply_filters( 'give_romania_states', $states );
983
}
984
985
/**
986
 * Get Pakistan States
987
 *
988
 * @since 1.8.12
989
 * @return array $states A list of states
990
 */
991
function give_get_pakistan_states_list() {
992
	$states = array(
993
		''   => '',
994
		'JK' => __( 'Azad Kashmir', 'give' ),
995
		'BA' => __( 'Balochistan', 'give' ),
996
		'TA' => __( 'FATA', 'give' ),
997
		'GB' => __( 'Gilgit Baltistan', 'give' ),
998
		'IS' => __( 'Islamabad Capital Territory', 'give' ),
999
		'KP' => __( 'Khyber Pakhtunkhwa', 'give' ),
1000
		'PB' => __( 'Punjab', 'give' ),
1001
		'SD' => __( 'Sindh', 'give' ),
1002
	);
1003
1004
	return apply_filters( 'give_pakistan_states', $states );
1005
}
1006
1007
/**
1008
 * Get Philippines States
1009
 *
1010
 * @since 1.8.12
1011
 * @return array $states A list of states
1012
 */
1013
function give_get_philippines_states_list() {
1014
	$states = array(
1015
		''    => '',
1016
		'ABR' => __( 'Abra', 'give' ),
1017
		'AGN' => __( 'Agusan del Norte', 'give' ),
1018
		'AGS' => __( 'Agusan del Sur', 'give' ),
1019
		'AKL' => __( 'Aklan', 'give' ),
1020
		'ALB' => __( 'Albay', 'give' ),
1021
		'ANT' => __( 'Antique', 'give' ),
1022
		'APA' => __( 'Apayao', 'give' ),
1023
		'AUR' => __( 'Aurora', 'give' ),
1024
		'BAS' => __( 'Basilan', 'give' ),
1025
		'BAN' => __( 'Bataan', 'give' ),
1026
		'BTN' => __( 'Batanes', 'give' ),
1027
		'BTG' => __( 'Batangas', 'give' ),
1028
		'BEN' => __( 'Benguet', 'give' ),
1029
		'BIL' => __( 'Biliran', 'give' ),
1030
		'BOH' => __( 'Bohol', 'give' ),
1031
		'BUK' => __( 'Bukidnon', 'give' ),
1032
		'BUL' => __( 'Bulacan', 'give' ),
1033
		'CAG' => __( 'Cagayan', 'give' ),
1034
		'CAN' => __( 'Camarines Norte', 'give' ),
1035
		'CAS' => __( 'Camarines Sur', 'give' ),
1036
		'CAM' => __( 'Camiguin', 'give' ),
1037
		'CAP' => __( 'Capiz', 'give' ),
1038
		'CAT' => __( 'Catanduanes', 'give' ),
1039
		'CAV' => __( 'Cavite', 'give' ),
1040
		'CEB' => __( 'Cebu', 'give' ),
1041
		'COM' => __( 'Compostela Valley', 'give' ),
1042
		'NCO' => __( 'Cotabato', 'give' ),
1043
		'DAV' => __( 'Davao del Norte', 'give' ),
1044
		'DAS' => __( 'Davao del Sur', 'give' ),
1045
		'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned
1046
		'DAO' => __( 'Davao Oriental', 'give' ),
1047
		'DIN' => __( 'Dinagat Islands', 'give' ),
1048
		'EAS' => __( 'Eastern Samar', 'give' ),
1049
		'GUI' => __( 'Guimaras', 'give' ),
1050
		'IFU' => __( 'Ifugao', 'give' ),
1051
		'ILN' => __( 'Ilocos Norte', 'give' ),
1052
		'ILS' => __( 'Ilocos Sur', 'give' ),
1053
		'ILI' => __( 'Iloilo', 'give' ),
1054
		'ISA' => __( 'Isabela', 'give' ),
1055
		'KAL' => __( 'Kalinga', 'give' ),
1056
		'LUN' => __( 'La Union', 'give' ),
1057
		'LAG' => __( 'Laguna', 'give' ),
1058
		'LAN' => __( 'Lanao del Norte', 'give' ),
1059
		'LAS' => __( 'Lanao del Sur', 'give' ),
1060
		'LEY' => __( 'Leyte', 'give' ),
1061
		'MAG' => __( 'Maguindanao', 'give' ),
1062
		'MAD' => __( 'Marinduque', 'give' ),
1063
		'MAS' => __( 'Masbate', 'give' ),
1064
		'MSC' => __( 'Misamis Occidental', 'give' ),
1065
		'MSR' => __( 'Misamis Oriental', 'give' ),
1066
		'MOU' => __( 'Mountain Province', 'give' ),
1067
		'NEC' => __( 'Negros Occidental', 'give' ),
1068
		'NER' => __( 'Negros Oriental', 'give' ),
1069
		'NSA' => __( 'Northern Samar', 'give' ),
1070
		'NUE' => __( 'Nueva Ecija', 'give' ),
1071
		'NUV' => __( 'Nueva Vizcaya', 'give' ),
1072
		'MDC' => __( 'Occidental Mindoro', 'give' ),
1073
		'MDR' => __( 'Oriental Mindoro', 'give' ),
1074
		'PLW' => __( 'Palawan', 'give' ),
1075
		'PAM' => __( 'Pampanga', 'give' ),
1076
		'PAN' => __( 'Pangasinan', 'give' ),
1077
		'QUE' => __( 'Quezon', 'give' ),
1078
		'QUI' => __( 'Quirino', 'give' ),
1079
		'RIZ' => __( 'Rizal', 'give' ),
1080
		'ROM' => __( 'Romblon', 'give' ),
1081
		'WSA' => __( 'Samar', 'give' ),
1082
		'SAR' => __( 'Sarangani', 'give' ),
1083
		'SIQ' => __( 'Siquijor', 'give' ),
1084
		'SOR' => __( 'Sorsogon', 'give' ),
1085
		'SCO' => __( 'South Cotabato', 'give' ),
1086
		'SLE' => __( 'Southern Leyte', 'give' ),
1087
		'SUK' => __( 'Sultan Kudarat', 'give' ),
1088
		'SLU' => __( 'Sulu', 'give' ),
1089
		'SUN' => __( 'Surigao del Norte', 'give' ),
1090
		'SUR' => __( 'Surigao del Sur', 'give' ),
1091
		'TAR' => __( 'Tarlac', 'give' ),
1092
		'TAW' => __( 'Tawi-Tawi', 'give' ),
1093
		'ZMB' => __( 'Zambales', 'give' ),
1094
		'ZAN' => __( 'Zamboanga del Norte', 'give' ),
1095
		'ZAS' => __( 'Zamboanga del Sur', 'give' ),
1096
		'ZSI' => __( 'Zamboanga Sibugay', 'give' ),
1097
		'00'  => __( 'Metro Manila', 'give' ),
1098
	);
1099
1100
	return apply_filters( 'give_philippines_states', $states );
1101
}
1102
1103
/**
1104
 * Get Peru States
1105
 *
1106
 * @since 1.8.12
1107
 * @return array $states A list of states
1108
 */
1109
function give_get_peru_states_list() {
1110
	$states = array(
1111
		''    => '',
1112
		'CAL' => __( 'El Callao', 'give' ),
1113
		'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ),
1114
		'AMA' => __( 'Amazonas', 'give' ),
1115
		'ANC' => __( 'Ancash', 'give' ),
1116
		'APU' => __( 'Apur&iacute;mac', 'give' ),
1117
		'ARE' => __( 'Arequipa', 'give' ),
1118
		'AYA' => __( 'Ayacucho', 'give' ),
1119
		'CAJ' => __( 'Cajamarca', 'give' ),
1120
		'CUS' => __( 'Cusco', 'give' ),
1121
		'HUV' => __( 'Huancavelica', 'give' ),
1122
		'HUC' => __( 'Hu&aacute;nuco', 'give' ),
1123
		'ICA' => __( 'Ica', 'give' ),
1124
		'JUN' => __( 'Jun&iacute;n', 'give' ),
1125
		'LAL' => __( 'La Libertad', 'give' ),
1126
		'LAM' => __( 'Lambayeque', 'give' ),
1127
		'LIM' => __( 'Lima', 'give' ),
1128
		'LOR' => __( 'Loreto', 'give' ),
1129
		'MDD' => __( 'Madre de Dios', 'give' ),
1130
		'MOQ' => __( 'Moquegua', 'give' ),
1131
		'PAS' => __( 'Pasco', 'give' ),
1132
		'PIU' => __( 'Piura', 'give' ),
1133
		'PUN' => __( 'Puno', 'give' ),
1134
		'SAM' => __( 'San Mart&iacute;n', 'give' ),
1135
		'TAC' => __( 'Tacna', 'give' ),
1136
		'TUM' => __( 'Tumbes', 'give' ),
1137
		'UCA' => __( 'Ucayali', 'give' ),
1138
	);
1139
1140
	return apply_filters( 'give_peru_states', $states );
1141
}
1142
1143
/**
1144
 * Get Nepal States
1145
 *
1146
 * @since 1.8.12
1147
 * @return array $states A list of states
1148
 */
1149
function give_get_nepal_states_list() {
1150
	$states = array(
1151
		''    => '',
1152
		'BAG' => __( 'Bagmati', 'give' ),
1153
		'BHE' => __( 'Bheri', 'give' ),
1154
		'DHA' => __( 'Dhaulagiri', 'give' ),
1155
		'GAN' => __( 'Gandaki', 'give' ),
1156
		'JAN' => __( 'Janakpur', 'give' ),
1157
		'KAR' => __( 'Karnali', 'give' ),
1158
		'KOS' => __( 'Koshi', 'give' ),
1159
		'LUM' => __( 'Lumbini', 'give' ),
1160
		'MAH' => __( 'Mahakali', 'give' ),
1161
		'MEC' => __( 'Mechi', 'give' ),
1162
		'NAR' => __( 'Narayani', 'give' ),
1163
		'RAP' => __( 'Rapti', 'give' ),
1164
		'SAG' => __( 'Sagarmatha', 'give' ),
1165
		'SET' => __( 'Seti', 'give' ),
1166
	);
1167
1168
	return apply_filters( 'give_nepal_states', $states );
1169
}
1170
1171
/**
1172
 * Get Nigerian States
1173
 *
1174
 * @since 1.8.12
1175
 * @return array $states A list of states
1176
 */
1177
function give_get_nigerian_states_list() {
1178
	$states = array(
1179
		''   => '',
1180
		'AB' => __( 'Abia', 'give' ),
1181
		'FC' => __( 'Abuja', 'give' ),
1182
		'AD' => __( 'Adamawa', 'give' ),
1183
		'AK' => __( 'Akwa Ibom', 'give' ),
1184
		'AN' => __( 'Anambra', 'give' ),
1185
		'BA' => __( 'Bauchi', 'give' ),
1186
		'BY' => __( 'Bayelsa', 'give' ),
1187
		'BE' => __( 'Benue', 'give' ),
1188
		'BO' => __( 'Borno', 'give' ),
1189
		'CR' => __( 'Cross River', 'give' ),
1190
		'DE' => __( 'Delta', 'give' ),
1191
		'EB' => __( 'Ebonyi', 'give' ),
1192
		'ED' => __( 'Edo', 'give' ),
1193
		'EK' => __( 'Ekiti', 'give' ),
1194
		'EN' => __( 'Enugu', 'give' ),
1195
		'GO' => __( 'Gombe', 'give' ),
1196
		'IM' => __( 'Imo', 'give' ),
1197
		'JI' => __( 'Jigawa', 'give' ),
1198
		'KD' => __( 'Kaduna', 'give' ),
1199
		'KN' => __( 'Kano', 'give' ),
1200
		'KT' => __( 'Katsina', 'give' ),
1201
		'KE' => __( 'Kebbi', 'give' ),
1202
		'KO' => __( 'Kogi', 'give' ),
1203
		'KW' => __( 'Kwara', 'give' ),
1204
		'LA' => __( 'Lagos', 'give' ),
1205
		'NA' => __( 'Nasarawa', 'give' ),
1206
		'NI' => __( 'Niger', 'give' ),
1207
		'OG' => __( 'Ogun', 'give' ),
1208
		'ON' => __( 'Ondo', 'give' ),
1209
		'OS' => __( 'Osun', 'give' ),
1210
		'OY' => __( 'Oyo', 'give' ),
1211
		'PL' => __( 'Plateau', 'give' ),
1212
		'RI' => __( 'Rivers', 'give' ),
1213
		'SO' => __( 'Sokoto', 'give' ),
1214
		'TA' => __( 'Taraba', 'give' ),
1215
		'YO' => __( 'Yobe', 'give' ),
1216
		'ZA' => __( 'Zamfara', 'give' ),
1217
	);
1218
1219
	return apply_filters( 'give_nigerian_states', $states );
1220
}
1221
1222
/**
1223
 * Get Mexico States
1224
 *
1225
 * @since 1.8.12
1226
 * @return array $states A list of states
1227
 */
1228
function give_get_mexico_states_list() {
1229
	$states = array(
1230
		''                    => '',
1231
		'Distrito Federal'    => __( 'Distrito Federal', 'give' ),
1232
		'Jalisco'             => __( 'Jalisco', 'give' ),
1233
		'Nuevo Leon'          => __( 'Nuevo León', 'give' ),
1234
		'Aguascalientes'      => __( 'Aguascalientes', 'give' ),
1235
		'Baja California'     => __( 'Baja California', 'give' ),
1236
		'Baja California Sur' => __( 'Baja California Sur', 'give' ),
1237
		'Campeche'            => __( 'Campeche', 'give' ),
1238
		'Chiapas'             => __( 'Chiapas', 'give' ),
1239
		'Chihuahua'           => __( 'Chihuahua', 'give' ),
1240
		'Coahuila'            => __( 'Coahuila', 'give' ),
1241
		'Colima'              => __( 'Colima', 'give' ),
1242
		'Durango'             => __( 'Durango', 'give' ),
1243
		'Guanajuato'          => __( 'Guanajuato', 'give' ),
1244
		'Guerrero'            => __( 'Guerrero', 'give' ),
1245
		'Hidalgo'             => __( 'Hidalgo', 'give' ),
1246
		'Estado de Mexico'    => __( 'Edo. de México', 'give' ),
1247
		'Michoacan'           => __( 'Michoacán', 'give' ),
1248
		'Morelos'             => __( 'Morelos', 'give' ),
1249
		'Nayarit'             => __( 'Nayarit', 'give' ),
1250
		'Oaxaca'              => __( 'Oaxaca', 'give' ),
1251
		'Puebla'              => __( 'Puebla', 'give' ),
1252
		'Queretaro'           => __( 'Querétaro', 'give' ),
1253
		'Quintana Roo'        => __( 'Quintana Roo', 'give' ),
1254
		'San Luis Potosi'     => __( 'San Luis Potosí', 'give' ),
1255
		'Sinaloa'             => __( 'Sinaloa', 'give' ),
1256
		'Sonora'              => __( 'Sonora', 'give' ),
1257
		'Tabasco'             => __( 'Tabasco', 'give' ),
1258
		'Tamaulipas'          => __( 'Tamaulipas', 'give' ),
1259
		'Tlaxcala'            => __( 'Tlaxcala', 'give' ),
1260
		'Veracruz'            => __( 'Veracruz', 'give' ),
1261
		'Yucatan'             => __( 'Yucatán', 'give' ),
1262
		'Zacatecas'           => __( 'Zacatecas', 'give' ),
1263
	);
1264
1265
	return apply_filters( 'give_mexico_states', $states );
1266
}
1267
1268
/**
1269
 * Get Japan States
1270
 *
1271
 * @since 1.8.12
1272
 * @return array $states A list of states
1273
 */
1274
function give_get_japan_states_list() {
1275
	$states = array(
1276
		''     => '',
1277
		'JP01' => __( 'Hokkaido', 'give' ),
1278
		'JP02' => __( 'Aomori', 'give' ),
1279
		'JP03' => __( 'Iwate', 'give' ),
1280
		'JP04' => __( 'Miyagi', 'give' ),
1281
		'JP05' => __( 'Akita', 'give' ),
1282
		'JP06' => __( 'Yamagata', 'give' ),
1283
		'JP07' => __( 'Fukushima', 'give' ),
1284
		'JP08' => __( 'Ibaraki', 'give' ),
1285
		'JP09' => __( 'Tochigi', 'give' ),
1286
		'JP10' => __( 'Gunma', 'give' ),
1287
		'JP11' => __( 'Saitama', 'give' ),
1288
		'JP12' => __( 'Chiba', 'give' ),
1289
		'JP13' => __( 'Tokyo', 'give' ),
1290
		'JP14' => __( 'Kanagawa', 'give' ),
1291
		'JP15' => __( 'Niigata', 'give' ),
1292
		'JP16' => __( 'Toyama', 'give' ),
1293
		'JP17' => __( 'Ishikawa', 'give' ),
1294
		'JP18' => __( 'Fukui', 'give' ),
1295
		'JP19' => __( 'Yamanashi', 'give' ),
1296
		'JP20' => __( 'Nagano', 'give' ),
1297
		'JP21' => __( 'Gifu', 'give' ),
1298
		'JP22' => __( 'Shizuoka', 'give' ),
1299
		'JP23' => __( 'Aichi', 'give' ),
1300
		'JP24' => __( 'Mie', 'give' ),
1301
		'JP25' => __( 'Shiga', 'give' ),
1302
		'JP26' => __( 'Kyoto', 'give' ),
1303
		'JP27' => __( 'Osaka', 'give' ),
1304
		'JP28' => __( 'Hyogo', 'give' ),
1305
		'JP29' => __( 'Nara', 'give' ),
1306
		'JP30' => __( 'Wakayama', 'give' ),
1307
		'JP31' => __( 'Tottori', 'give' ),
1308
		'JP32' => __( 'Shimane', 'give' ),
1309
		'JP33' => __( 'Okayama', 'give' ),
1310
		'JP34' => __( 'Hiroshima', 'give' ),
1311
		'JP35' => __( 'Yamaguchi', 'give' ),
1312
		'JP36' => __( 'Tokushima', 'give' ),
1313
		'JP37' => __( 'Kagawa', 'give' ),
1314
		'JP38' => __( 'Ehime', 'give' ),
1315
		'JP39' => __( 'Kochi', 'give' ),
1316
		'JP40' => __( 'Fukuoka', 'give' ),
1317
		'JP41' => __( 'Saga', 'give' ),
1318
		'JP42' => __( 'Nagasaki', 'give' ),
1319
		'JP43' => __( 'Kumamoto', 'give' ),
1320
		'JP44' => __( 'Oita', 'give' ),
1321
		'JP45' => __( 'Miyazaki', 'give' ),
1322
		'JP46' => __( 'Kagoshima', 'give' ),
1323
		'JP47' => __( 'Okinawa', 'give' ),
1324
	);
1325
1326
	return apply_filters( 'give_japan_states', $states );
1327
}
1328
1329
/**
1330
 * Get Italy States
1331
 *
1332
 * @since 1.8.12
1333
 * @return array $states A list of states
1334
 */
1335
function give_get_italy_states_list() {
1336
	$states = array(
1337
		''   => '',
1338
		'AG' => __( 'Agrigento', 'give' ),
1339
		'AL' => __( 'Alessandria', 'give' ),
1340
		'AN' => __( 'Ancona', 'give' ),
1341
		'AO' => __( 'Aosta', 'give' ),
1342
		'AR' => __( 'Arezzo', 'give' ),
1343
		'AP' => __( 'Ascoli Piceno', 'give' ),
1344
		'AT' => __( 'Asti', 'give' ),
1345
		'AV' => __( 'Avellino', 'give' ),
1346
		'BA' => __( 'Bari', 'give' ),
1347
		'BT' => __( 'Barletta-Andria-Trani', 'give' ),
1348
		'BL' => __( 'Belluno', 'give' ),
1349
		'BN' => __( 'Benevento', 'give' ),
1350
		'BG' => __( 'Bergamo', 'give' ),
1351
		'BI' => __( 'Biella', 'give' ),
1352
		'BO' => __( 'Bologna', 'give' ),
1353
		'BZ' => __( 'Bolzano', 'give' ),
1354
		'BS' => __( 'Brescia', 'give' ),
1355
		'BR' => __( 'Brindisi', 'give' ),
1356
		'CA' => __( 'Cagliari', 'give' ),
1357
		'CL' => __( 'Caltanissetta', 'give' ),
1358
		'CB' => __( 'Campobasso', 'give' ),
1359
		'CI' => __( 'Carbonia-Iglesias', 'give' ),
1360
		'CE' => __( 'Caserta', 'give' ),
1361
		'CT' => __( 'Catania', 'give' ),
1362
		'CZ' => __( 'Catanzaro', 'give' ),
1363
		'CH' => __( 'Chieti', 'give' ),
1364
		'CO' => __( 'Como', 'give' ),
1365
		'CS' => __( 'Cosenza', 'give' ),
1366
		'CR' => __( 'Cremona', 'give' ),
1367
		'KR' => __( 'Crotone', 'give' ),
1368
		'CN' => __( 'Cuneo', 'give' ),
1369
		'EN' => __( 'Enna', 'give' ),
1370
		'FM' => __( 'Fermo', 'give' ),
1371
		'FE' => __( 'Ferrara', 'give' ),
1372
		'FI' => __( 'Firenze', 'give' ),
1373
		'FG' => __( 'Foggia', 'give' ),
1374
		'FC' => __( 'Forlì-Cesena', 'give' ),
1375
		'FR' => __( 'Frosinone', 'give' ),
1376
		'GE' => __( 'Genova', 'give' ),
1377
		'GO' => __( 'Gorizia', 'give' ),
1378
		'GR' => __( 'Grosseto', 'give' ),
1379
		'IM' => __( 'Imperia', 'give' ),
1380
		'IS' => __( 'Isernia', 'give' ),
1381
		'SP' => __( 'La Spezia', 'give' ),
1382
		'AQ' => __( "L'Aquila", 'give' ),
1383
		'LT' => __( 'Latina', 'give' ),
1384
		'LE' => __( 'Lecce', 'give' ),
1385
		'LC' => __( 'Lecco', 'give' ),
1386
		'LI' => __( 'Livorno', 'give' ),
1387
		'LO' => __( 'Lodi', 'give' ),
1388
		'LU' => __( 'Lucca', 'give' ),
1389
		'MC' => __( 'Macerata', 'give' ),
1390
		'MN' => __( 'Mantova', 'give' ),
1391
		'MS' => __( 'Massa-Carrara', 'give' ),
1392
		'MT' => __( 'Matera', 'give' ),
1393
		'ME' => __( 'Messina', 'give' ),
1394
		'MI' => __( 'Milano', 'give' ),
1395
		'MO' => __( 'Modena', 'give' ),
1396
		'MB' => __( 'Monza e della Brianza', 'give' ),
1397
		'NA' => __( 'Napoli', 'give' ),
1398
		'NO' => __( 'Novara', 'give' ),
1399
		'NU' => __( 'Nuoro', 'give' ),
1400
		'OT' => __( 'Olbia-Tempio', 'give' ),
1401
		'OR' => __( 'Oristano', 'give' ),
1402
		'PD' => __( 'Padova', 'give' ),
1403
		'PA' => __( 'Palermo', 'give' ),
1404
		'PR' => __( 'Parma', 'give' ),
1405
		'PV' => __( 'Pavia', 'give' ),
1406
		'PG' => __( 'Perugia', 'give' ),
1407
		'PU' => __( 'Pesaro e Urbino', 'give' ),
1408
		'PE' => __( 'Pescara', 'give' ),
1409
		'PC' => __( 'Piacenza', 'give' ),
1410
		'PI' => __( 'Pisa', 'give' ),
1411
		'PT' => __( 'Pistoia', 'give' ),
1412
		'PN' => __( 'Pordenone', 'give' ),
1413
		'PZ' => __( 'Potenza', 'give' ),
1414
		'PO' => __( 'Prato', 'give' ),
1415
		'RG' => __( 'Ragusa', 'give' ),
1416
		'RA' => __( 'Ravenna', 'give' ),
1417
		'RC' => __( 'Reggio Calabria', 'give' ),
1418
		'RE' => __( 'Reggio Emilia', 'give' ),
1419
		'RI' => __( 'Rieti', 'give' ),
1420
		'RN' => __( 'Rimini', 'give' ),
1421
		'RM' => __( 'Roma', 'give' ),
1422
		'RO' => __( 'Rovigo', 'give' ),
1423
		'SA' => __( 'Salerno', 'give' ),
1424
		'VS' => __( 'Medio Campidano', 'give' ),
1425
		'SS' => __( 'Sassari', 'give' ),
1426
		'SV' => __( 'Savona', 'give' ),
1427
		'SI' => __( 'Siena', 'give' ),
1428
		'SR' => __( 'Siracusa', 'give' ),
1429
		'SO' => __( 'Sondrio', 'give' ),
1430
		'TA' => __( 'Taranto', 'give' ),
1431
		'TE' => __( 'Teramo', 'give' ),
1432
		'TR' => __( 'Terni', 'give' ),
1433
		'TO' => __( 'Torino', 'give' ),
1434
		'OG' => __( 'Ogliastra', 'give' ),
1435
		'TP' => __( 'Trapani', 'give' ),
1436
		'TN' => __( 'Trento', 'give' ),
1437
		'TV' => __( 'Treviso', 'give' ),
1438
		'TS' => __( 'Trieste', 'give' ),
1439
		'UD' => __( 'Udine', 'give' ),
1440
		'VA' => __( 'Varese', 'give' ),
1441
		'VE' => __( 'Venezia', 'give' ),
1442
		'VB' => __( 'Verbano-Cusio-Ossola', 'give' ),
1443
		'VC' => __( 'Vercelli', 'give' ),
1444
		'VR' => __( 'Verona', 'give' ),
1445
		'VV' => __( 'Vibo Valentia', 'give' ),
1446
		'VI' => __( 'Vicenza', 'give' ),
1447
		'VT' => __( 'Viterbo', 'give' ),
1448
	);
1449
1450
	return apply_filters( 'give_italy_states', $states );
1451
}
1452
1453
/**
1454
 * Get Iran States
1455
 *
1456
 * @since 1.8.12
1457
 * @return array $states A list of states
1458
 */
1459
function give_get_iran_states_list() {
1460
	$states = array(
1461
		''    => '',
1462
		'KHZ' => __( 'Khuzestan  (خوزستان)', 'give' ),
1463
		'THR' => __( 'Tehran  (تهران)', 'give' ),
1464
		'ILM' => __( 'Ilaam (ایلام)', 'give' ),
1465
		'BHR' => __( 'Bushehr (بوشهر)', 'give' ),
1466
		'ADL' => __( 'Ardabil (اردبیل)', 'give' ),
1467
		'ESF' => __( 'Isfahan (اصفهان)', 'give' ),
1468
		'YZD' => __( 'Yazd (یزد)', 'give' ),
1469
		'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ),
1470
		'KRN' => __( 'Kerman (کرمان)', 'give' ),
1471
		'HDN' => __( 'Hamadan (همدان)', 'give' ),
1472
		'GZN' => __( 'Ghazvin (قزوین)', 'give' ),
1473
		'ZJN' => __( 'Zanjan (زنجان)', 'give' ),
1474
		'LRS' => __( 'Luristan (لرستان)', 'give' ),
1475
		'ABZ' => __( 'Alborz (البرز)', 'give' ),
1476
		'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ),
1477
		'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ),
1478
		'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ),
1479
		'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ),
1480
		'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ),
1481
		'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ),
1482
		'SMN' => __( 'Semnan (سمنان)', 'give' ),
1483
		'FRS' => __( 'Fars (فارس)', 'give' ),
1484
		'QHM' => __( 'Qom (قم)', 'give' ),
1485
		'KRD' => __( 'Kurdistan / کردستان)', 'give' ),
1486
		'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ),
1487
		'GLS' => __( 'Golestan (گلستان)', 'give' ),
1488
		'GIL' => __( 'Gilan (گیلان)', 'give' ),
1489
		'MZN' => __( 'Mazandaran (مازندران)', 'give' ),
1490
		'MKZ' => __( 'Markazi (مرکزی)', 'give' ),
1491
		'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ),
1492
		'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ),
1493
	);
1494
1495
	return apply_filters( 'give_iran_states', $states );
1496
}
1497
1498
/**
1499
 * Get Ireland States
1500
 *
1501
 * @since 1.8.12
1502
 * @return array $states A list of states
1503
 */
1504
function give_get_ireland_states_list() {
1505
	$states = array(
1506
		''   => '',
1507
		'AN' => __( 'Antrim', 'give' ),
1508
		'AR' => __( 'Armagh', 'give' ),
1509
		'CE' => __( 'Clare', 'give' ),
1510
		'CK' => __( 'Cork', 'give' ),
1511
		'CN' => __( 'Cavan', 'give' ),
1512
		'CW' => __( 'Carlow', 'give' ),
1513
		'DL' => __( 'Donegal', 'give' ),
1514
		'DN' => __( 'Dublin', 'give' ),
1515
		'DO' => __( 'Down', 'give' ),
1516
		'DY' => __( 'Derry', 'give' ),
1517
		'FM' => __( 'Fermanagh', 'give' ),
1518
		'GY' => __( 'Galway', 'give' ),
1519
		'KE' => __( 'Kildare', 'give' ),
1520
		'KK' => __( 'Kilkenny', 'give' ),
1521
		'KY' => __( 'Kerry', 'give' ),
1522
		'LD' => __( 'Longford', 'give' ),
1523
		'LH' => __( 'Louth', 'give' ),
1524
		'LK' => __( 'Limerick', 'give' ),
1525
		'LM' => __( 'Leitrim', 'give' ),
1526
		'LS' => __( 'Laois', 'give' ),
1527
		'MH' => __( 'Meath', 'give' ),
1528
		'MN' => __( 'Monaghan', 'give' ),
1529
		'MO' => __( 'Mayo', 'give' ),
1530
		'OY' => __( 'Offaly', 'give' ),
1531
		'RN' => __( 'Roscommon', 'give' ),
1532
		'SO' => __( 'Sligo', 'give' ),
1533
		'TR' => __( 'Tyrone', 'give' ),
1534
		'TY' => __( 'Tipperary', 'give' ),
1535
		'WD' => __( 'Waterford', 'give' ),
1536
		'WH' => __( 'Westmeath', 'give' ),
1537
		'WW' => __( 'Wicklow', 'give' ),
1538
		'WX' => __( 'Wexford', 'give' ),
1539
	);
1540
1541
	return apply_filters( 'give_ireland_states', $states );
1542
}
1543
1544
/**
1545
 * Get Greek States
1546
 *
1547
 * @since 1.8.12
1548
 * @return array $states A list of states
1549
 */
1550
function give_get_greek_states_list() {
1551
	$states = array(
1552
		''  => '',
1553
		'I' => __( 'Αττική', 'give' ),
1554
		'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ),
1555
		'B' => __( 'Κεντρική Μακεδονία', 'give' ),
1556
		'C' => __( 'Δυτική Μακεδονία', 'give' ),
1557
		'D' => __( 'Ήπειρος', 'give' ),
1558
		'E' => __( 'Θεσσαλία', 'give' ),
1559
		'F' => __( 'Ιόνιοι Νήσοι', 'give' ),
1560
		'G' => __( 'Δυτική Ελλάδα', 'give' ),
1561
		'H' => __( 'Στερεά Ελλάδα', 'give' ),
1562
		'J' => __( 'Πελοπόννησος', 'give' ),
1563
		'K' => __( 'Βόρειο Αιγαίο', 'give' ),
1564
		'L' => __( 'Νότιο Αιγαίο', 'give' ),
1565
		'M' => __( 'Κρήτη', 'give' ),
1566
	);
1567
1568
	return apply_filters( 'give_greek_states', $states );
1569
}
1570
1571
/**
1572
 * Get bolivian States
1573
 *
1574
 * @since 1.8.12
1575
 * @return array $states A list of states
1576
 */
1577
function give_get_bolivian_states_list() {
1578
	$states = array(
1579
		''  => '',
1580
		'B' => __( 'Chuquisaca', 'give' ),
1581
		'H' => __( 'Beni', 'give' ),
1582
		'C' => __( 'Cochabamba', 'give' ),
1583
		'L' => __( 'La Paz', 'give' ),
1584
		'O' => __( 'Oruro', 'give' ),
1585
		'N' => __( 'Pando', 'give' ),
1586
		'P' => __( 'Potosí', 'give' ),
1587
		'S' => __( 'Santa Cruz', 'give' ),
1588
		'T' => __( 'Tarija', 'give' ),
1589
	);
1590
1591
	return apply_filters( 'give_bolivian_states', $states );
1592
}
1593
1594
/**
1595
 * Get Bulgarian States
1596
 *
1597
 * @since 1.8.12
1598
 * @return array $states A list of states
1599
 */
1600
function give_get_bulgarian_states_list() {
1601
	$states = array(
1602
		''      => '',
1603
		'BG-01' => __( 'Blagoevgrad', 'give' ),
1604
		'BG-02' => __( 'Burgas', 'give' ),
1605
		'BG-08' => __( 'Dobrich', 'give' ),
1606
		'BG-07' => __( 'Gabrovo', 'give' ),
1607
		'BG-26' => __( 'Haskovo', 'give' ),
1608
		'BG-09' => __( 'Kardzhali', 'give' ),
1609
		'BG-10' => __( 'Kyustendil', 'give' ),
1610
		'BG-11' => __( 'Lovech', 'give' ),
1611
		'BG-12' => __( 'Montana', 'give' ),
1612
		'BG-13' => __( 'Pazardzhik', 'give' ),
1613
		'BG-14' => __( 'Pernik', 'give' ),
1614
		'BG-15' => __( 'Pleven', 'give' ),
1615
		'BG-16' => __( 'Plovdiv', 'give' ),
1616
		'BG-17' => __( 'Razgrad', 'give' ),
1617
		'BG-18' => __( 'Ruse', 'give' ),
1618
		'BG-27' => __( 'Shumen', 'give' ),
1619
		'BG-19' => __( 'Silistra', 'give' ),
1620
		'BG-20' => __( 'Sliven', 'give' ),
1621
		'BG-21' => __( 'Smolyan', 'give' ),
1622
		'BG-23' => __( 'Sofia', 'give' ),
1623
		'BG-22' => __( 'Sofia-Grad', 'give' ),
1624
		'BG-24' => __( 'Stara Zagora', 'give' ),
1625
		'BG-25' => __( 'Targovishte', 'give' ),
1626
		'BG-03' => __( 'Varna', 'give' ),
1627
		'BG-04' => __( 'Veliko Tarnovo', 'give' ),
1628
		'BG-05' => __( 'Vidin', 'give' ),
1629
		'BG-06' => __( 'Vratsa', 'give' ),
1630
		'BG-28' => __( 'Yambol', 'give' ),
1631
	);
1632
1633
	return apply_filters( 'give_bulgarian_states', $states );
1634
}
1635
1636
/**
1637
 * Get Bangladeshi States
1638
 *
1639
 * @since 1.8.12.
1640
 * @return array $states A list of states
1641
 */
1642
function give_get_bangladeshi_states_list() {
1643
	$states = array(
1644
		''     => '',
1645
		'BAG'  => __( 'Bagerhat', 'give' ),
1646
		'BAN'  => __( 'Bandarban', 'give' ),
1647
		'BAR'  => __( 'Barguna', 'give' ),
1648
		'BARI' => __( 'Barisal', 'give' ),
1649
		'BHO'  => __( 'Bhola', 'give' ),
1650
		'BOG'  => __( 'Bogra', 'give' ),
1651
		'BRA'  => __( 'Brahmanbaria', 'give' ),
1652
		'CHA'  => __( 'Chandpur', 'give' ),
1653
		'CHI'  => __( 'Chittagong', 'give' ),
1654
		'CHU'  => __( 'Chuadanga', 'give' ),
1655
		'COM'  => __( 'Comilla', 'give' ),
1656
		'COX'  => __( "Cox's Bazar", 'give' ),
1657
		'DHA'  => __( 'Dhaka', 'give' ),
1658
		'DIN'  => __( 'Dinajpur', 'give' ),
1659
		'FAR'  => __( 'Faridpur ', 'give' ),
1660
		'FEN'  => __( 'Feni', 'give' ),
1661
		'GAI'  => __( 'Gaibandha', 'give' ),
1662
		'GAZI' => __( 'Gazipur', 'give' ),
1663
		'GOP'  => __( 'Gopalganj', 'give' ),
1664
		'HAB'  => __( 'Habiganj', 'give' ),
1665
		'JAM'  => __( 'Jamalpur', 'give' ),
1666
		'JES'  => __( 'Jessore', 'give' ),
1667
		'JHA'  => __( 'Jhalokati', 'give' ),
1668
		'JHE'  => __( 'Jhenaidah', 'give' ),
1669
		'JOY'  => __( 'Joypurhat', 'give' ),
1670
		'KHA'  => __( 'Khagrachhari', 'give' ),
1671
		'KHU'  => __( 'Khulna', 'give' ),
1672
		'KIS'  => __( 'Kishoreganj', 'give' ),
1673
		'KUR'  => __( 'Kurigram', 'give' ),
1674
		'KUS'  => __( 'Kushtia', 'give' ),
1675
		'LAK'  => __( 'Lakshmipur', 'give' ),
1676
		'LAL'  => __( 'Lalmonirhat', 'give' ),
1677
		'MAD'  => __( 'Madaripur', 'give' ),
1678
		'MAG'  => __( 'Magura', 'give' ),
1679
		'MAN'  => __( 'Manikganj ', 'give' ),
1680
		'MEH'  => __( 'Meherpur', 'give' ),
1681
		'MOU'  => __( 'Moulvibazar', 'give' ),
1682
		'MUN'  => __( 'Munshiganj', 'give' ),
1683
		'MYM'  => __( 'Mymensingh', 'give' ),
1684
		'NAO'  => __( 'Naogaon', 'give' ),
1685
		'NAR'  => __( 'Narail', 'give' ),
1686
		'NARG' => __( 'Narayanganj', 'give' ),
1687
		'NARD' => __( 'Narsingdi', 'give' ),
1688
		'NAT'  => __( 'Natore', 'give' ),
1689
		'NAW'  => __( 'Nawabganj', 'give' ),
1690
		'NET'  => __( 'Netrakona', 'give' ),
1691
		'NIL'  => __( 'Nilphamari', 'give' ),
1692
		'NOA'  => __( 'Noakhali', 'give' ),
1693
		'PAB'  => __( 'Pabna', 'give' ),
1694
		'PAN'  => __( 'Panchagarh', 'give' ),
1695
		'PAT'  => __( 'Patuakhali', 'give' ),
1696
		'PIR'  => __( 'Pirojpur', 'give' ),
1697
		'RAJB' => __( 'Rajbari', 'give' ),
1698
		'RAJ'  => __( 'Rajshahi', 'give' ),
1699
		'RAN'  => __( 'Rangamati', 'give' ),
1700
		'RANP' => __( 'Rangpur', 'give' ),
1701
		'SAT'  => __( 'Satkhira', 'give' ),
1702
		'SHA'  => __( 'Shariatpur', 'give' ),
1703
		'SHE'  => __( 'Sherpur', 'give' ),
1704
		'SIR'  => __( 'Sirajganj', 'give' ),
1705
		'SUN'  => __( 'Sunamganj', 'give' ),
1706
		'SYL'  => __( 'Sylhet', 'give' ),
1707
		'TAN'  => __( 'Tangail', 'give' ),
1708
		'THA'  => __( 'Thakurgaon', 'give' ),
1709
	);
1710
1711
	return apply_filters( 'give_bangladeshi_states', $states );
1712
}
1713
1714
/**
1715
 * Get Argentina States
1716
 *
1717
 * @since 1.8.12
1718
 * @return array $states A list of states
1719
 */
1720
function give_get_argentina_states_list() {
1721
	$states = array(
1722
		''  => '',
1723
		'C' => __( 'Ciudad Aut&oacute;noma de Buenos Aires', 'give' ),
1724
		'B' => __( 'Buenos Aires', 'give' ),
1725
		'K' => __( 'Catamarca', 'give' ),
1726
		'H' => __( 'Chaco', 'give' ),
1727
		'U' => __( 'Chubut', 'give' ),
1728
		'X' => __( 'C&oacute;rdoba', 'give' ),
1729
		'W' => __( 'Corrientes', 'give' ),
1730
		'E' => __( 'Entre R&iacute;os', 'give' ),
1731
		'P' => __( 'Formosa', 'give' ),
1732
		'Y' => __( 'Jujuy', 'give' ),
1733
		'L' => __( 'La Pampa', 'give' ),
1734
		'F' => __( 'La Rioja', 'give' ),
1735
		'M' => __( 'Mendoza', 'give' ),
1736
		'N' => __( 'Misiones', 'give' ),
1737
		'Q' => __( 'Neuqu&eacute;n', 'give' ),
1738
		'R' => __( 'R&iacute;o Negro', 'give' ),
1739
		'A' => __( 'Salta', 'give' ),
1740
		'J' => __( 'San Juan', 'give' ),
1741
		'D' => __( 'San Luis', 'give' ),
1742
		'Z' => __( 'Santa Cruz', 'give' ),
1743
		'S' => __( 'Santa Fe', 'give' ),
1744
		'G' => __( 'Santiago del Estero', 'give' ),
1745
		'V' => __( 'Tierra del Fuego', 'give' ),
1746
		'T' => __( 'Tucum&aacute;n', 'give' ),
1747
	);
1748
1749
	return apply_filters( 'give_argentina_states', $states );
1750
}
1751
1752
/**
1753
 * Get States List
1754
 *
1755
 * @access      public
1756
 * @since       1.2
1757
 * @return      array
1758
 */
1759
function give_get_states_list() {
1760
	$states = array(
1761
		''   => '',
1762
		'AL' => 'Alabama',
1763
		'AK' => 'Alaska',
1764
		'AZ' => 'Arizona',
1765
		'AR' => 'Arkansas',
1766
		'CA' => 'California',
1767
		'CO' => 'Colorado',
1768
		'CT' => 'Connecticut',
1769
		'DE' => 'Delaware',
1770
		'DC' => 'District of Columbia',
1771
		'FL' => 'Florida',
1772
		'GA' => 'Georgia',
1773
		'HI' => 'Hawaii',
1774
		'ID' => 'Idaho',
1775
		'IL' => 'Illinois',
1776
		'IN' => 'Indiana',
1777
		'IA' => 'Iowa',
1778
		'KS' => 'Kansas',
1779
		'KY' => 'Kentucky',
1780
		'LA' => 'Louisiana',
1781
		'ME' => 'Maine',
1782
		'MD' => 'Maryland',
1783
		'MA' => 'Massachusetts',
1784
		'MI' => 'Michigan',
1785
		'MN' => 'Minnesota',
1786
		'MS' => 'Mississippi',
1787
		'MO' => 'Missouri',
1788
		'MT' => 'Montana',
1789
		'NE' => 'Nebraska',
1790
		'NV' => 'Nevada',
1791
		'NH' => 'New Hampshire',
1792
		'NJ' => 'New Jersey',
1793
		'NM' => 'New Mexico',
1794
		'NY' => 'New York',
1795
		'NC' => 'North Carolina',
1796
		'ND' => 'North Dakota',
1797
		'OH' => 'Ohio',
1798
		'OK' => 'Oklahoma',
1799
		'OR' => 'Oregon',
1800
		'PA' => 'Pennsylvania',
1801
		'RI' => 'Rhode Island',
1802
		'SC' => 'South Carolina',
1803
		'SD' => 'South Dakota',
1804
		'TN' => 'Tennessee',
1805
		'TX' => 'Texas',
1806
		'UT' => 'Utah',
1807
		'VT' => 'Vermont',
1808
		'VA' => 'Virginia',
1809
		'WA' => 'Washington',
1810
		'WV' => 'West Virginia',
1811
		'WI' => 'Wisconsin',
1812
		'WY' => 'Wyoming',
1813
		'AS' => 'American Samoa',
1814
		'CZ' => 'Canal Zone',
1815
		'CM' => 'Commonwealth of the Northern Mariana Islands',
1816
		'FM' => 'Federated States of Micronesia',
1817
		'GU' => 'Guam',
1818
		'MH' => 'Marshall Islands',
1819
		'MP' => 'Northern Mariana Islands',
1820
		'PW' => 'Palau',
1821
		'PI' => 'Philippine Islands',
1822
		'PR' => 'Puerto Rico',
1823
		'TT' => 'Trust Territory of the Pacific Islands',
1824
		'VI' => 'Virgin Islands',
1825
		'AA' => 'Armed Forces - Americas',
1826
		'AE' => 'Armed Forces - Europe, Canada, Middle East, Africa',
1827
		'AP' => 'Armed Forces - Pacific',
1828
	);
1829
1830
	return apply_filters( 'give_us_states', $states );
1831
}
1832
1833
/**
1834
 * Get Provinces List
1835
 *
1836
 * @access      public
1837
 * @since       1.0
1838
 * @return      array
1839
 */
1840
function give_get_provinces_list() {
1841
	$provinces = array(
1842
		''   => '',
1843
		'AB' => esc_html__( 'Alberta', 'give' ),
1844
		'BC' => esc_html__( 'British Columbia', 'give' ),
1845
		'MB' => esc_html__( 'Manitoba', 'give' ),
1846
		'NB' => esc_html__( 'New Brunswick', 'give' ),
1847
		'NL' => esc_html__( 'Newfoundland and Labrador', 'give' ),
1848
		'NS' => esc_html__( 'Nova Scotia', 'give' ),
1849
		'NT' => esc_html__( 'Northwest Territories', 'give' ),
1850
		'NU' => esc_html__( 'Nunavut', 'give' ),
1851
		'ON' => esc_html__( 'Ontario', 'give' ),
1852
		'PE' => esc_html__( 'Prince Edward Island', 'give' ),
1853
		'QC' => esc_html__( 'Quebec', 'give' ),
1854
		'SK' => esc_html__( 'Saskatchewan', 'give' ),
1855
		'YT' => esc_html__( 'Yukon', 'give' ),
1856
	);
1857
1858
	return apply_filters( 'give_canada_provinces', $provinces );
1859
}
1860
1861
/**
1862
 * Get Australian States
1863
 *
1864
 * @since 1.0
1865
 * @return array $states A list of states
1866
 */
1867
function give_get_australian_states_list() {
1868
	$states = array(
1869
		''    => '',
1870
		'ACT' => 'Australian Capital Territory',
1871
		'NSW' => 'New South Wales',
1872
		'NT'  => 'Northern Territory',
1873
		'QLD' => 'Queensland',
1874
		'SA'  => 'South Australia',
1875
		'TAS' => 'Tasmania',
1876
		'VIC' => 'Victoria',
1877
		'WA'  => 'Western Australia',
1878
	);
1879
1880
	return apply_filters( 'give_australian_states', $states );
1881
}
1882
1883
/**
1884
 * Get Brazil States
1885
 *
1886
 * @since 1.0
1887
 * @return array $states A list of states
1888
 */
1889
function give_get_brazil_states_list() {
1890
	$states = array(
1891
		''   => '',
1892
		'AC' => 'Acre',
1893
		'AL' => 'Alagoas',
1894
		'AP' => 'Amap&aacute;',
1895
		'AM' => 'Amazonas',
1896
		'BA' => 'Bahia',
1897
		'CE' => 'Cear&aacute;',
1898
		'DF' => 'Distrito Federal',
1899
		'ES' => 'Esp&iacute;rito Santo',
1900
		'GO' => 'Goi&aacute;s',
1901
		'MA' => 'Maranh&atilde;o',
1902
		'MT' => 'Mato Grosso',
1903
		'MS' => 'Mato Grosso do Sul',
1904
		'MG' => 'Minas Gerais',
1905
		'PA' => 'Par&aacute;',
1906
		'PB' => 'Para&iacute;ba',
1907
		'PR' => 'Paran&aacute;',
1908
		'PE' => 'Pernambuco',
1909
		'PI' => 'Piau&iacute;',
1910
		'RJ' => 'Rio de Janeiro',
1911
		'RN' => 'Rio Grande do Norte',
1912
		'RS' => 'Rio Grande do Sul',
1913
		'RO' => 'Rond&ocirc;nia',
1914
		'RR' => 'Roraima',
1915
		'SC' => 'Santa Catarina',
1916
		'SP' => 'S&atilde;o Paulo',
1917
		'SE' => 'Sergipe',
1918
		'TO' => 'Tocantins',
1919
	);
1920
1921
	return apply_filters( 'give_brazil_states', $states );
1922
}
1923
1924
/**
1925
 * Get Hong Kong States
1926
 *
1927
 * @since 1.0
1928
 * @return array $states A list of states
1929
 */
1930
function give_get_hong_kong_states_list() {
1931
	$states = array(
1932
		''                => '',
1933
		'HONG KONG'       => 'Hong Kong Island',
1934
		'KOWLOON'         => 'Kowloon',
1935
		'NEW TERRITORIES' => 'New Territories',
1936
	);
1937
1938
	return apply_filters( 'give_hong_kong_states', $states );
1939
}
1940
1941
/**
1942
 * Get Hungary States
1943
 *
1944
 * @since 1.0
1945
 * @return array $states A list of states
1946
 */
1947
function give_get_hungary_states_list() {
1948
	$states = array(
1949
		''   => '',
1950
		'BK' => 'Bács-Kiskun',
1951
		'BE' => 'Békés',
1952
		'BA' => 'Baranya',
1953
		'BZ' => 'Borsod-Abaúj-Zemplén',
1954
		'BU' => 'Budapest',
1955
		'CS' => 'Csongrád',
1956
		'FE' => 'Fejér',
1957
		'GS' => 'Győr-Moson-Sopron',
1958
		'HB' => 'Hajdú-Bihar',
1959
		'HE' => 'Heves',
1960
		'JN' => 'Jász-Nagykun-Szolnok',
1961
		'KE' => 'Komárom-Esztergom',
1962
		'NO' => 'Nógrád',
1963
		'PE' => 'Pest',
1964
		'SO' => 'Somogy',
1965
		'SZ' => 'Szabolcs-Szatmár-Bereg',
1966
		'TO' => 'Tolna',
1967
		'VA' => 'Vas',
1968
		'VE' => 'Veszprém',
1969
		'ZA' => 'Zala',
1970
	);
1971
1972
	return apply_filters( 'give_hungary_states', $states );
1973
}
1974
1975
/**
1976
 * Get Chinese States
1977
 *
1978
 * @since 1.0
1979
 * @return array $states A list of states
1980
 */
1981
function give_get_chinese_states_list() {
1982
	$states = array(
1983
		''     => '',
1984
		'CN1'  => 'Yunnan / &#20113;&#21335;',
1985
		'CN2'  => 'Beijing / &#21271;&#20140;',
1986
		'CN3'  => 'Tianjin / &#22825;&#27941;',
1987
		'CN4'  => 'Hebei / &#27827;&#21271;',
1988
		'CN5'  => 'Shanxi / &#23665;&#35199;',
1989
		'CN6'  => 'Inner Mongolia / &#20839;&#33945;&#21476;',
1990
		'CN7'  => 'Liaoning / &#36797;&#23425;',
1991
		'CN8'  => 'Jilin / &#21513;&#26519;',
1992
		'CN9'  => 'Heilongjiang / &#40657;&#40857;&#27743;',
1993
		'CN10' => 'Shanghai / &#19978;&#28023;',
1994
		'CN11' => 'Jiangsu / &#27743;&#33487;',
1995
		'CN12' => 'Zhejiang / &#27993;&#27743;',
1996
		'CN13' => 'Anhui / &#23433;&#24509;',
1997
		'CN14' => 'Fujian / &#31119;&#24314;',
1998
		'CN15' => 'Jiangxi / &#27743;&#35199;',
1999
		'CN16' => 'Shandong / &#23665;&#19996;',
2000
		'CN17' => 'Henan / &#27827;&#21335;',
2001
		'CN18' => 'Hubei / &#28246;&#21271;',
2002
		'CN19' => 'Hunan / &#28246;&#21335;',
2003
		'CN20' => 'Guangdong / &#24191;&#19996;',
2004
		'CN21' => 'Guangxi Zhuang / &#24191;&#35199;&#22766;&#26063;',
2005
		'CN22' => 'Hainan / &#28023;&#21335;',
2006
		'CN23' => 'Chongqing / &#37325;&#24198;',
2007
		'CN24' => 'Sichuan / &#22235;&#24029;',
2008
		'CN25' => 'Guizhou / &#36149;&#24030;',
2009
		'CN26' => 'Shaanxi / &#38485;&#35199;',
2010
		'CN27' => 'Gansu / &#29976;&#32899;',
2011
		'CN28' => 'Qinghai / &#38738;&#28023;',
2012
		'CN29' => 'Ningxia Hui / &#23425;&#22799;',
2013
		'CN30' => 'Macau / &#28595;&#38376;',
2014
		'CN31' => 'Tibet / &#35199;&#34255;',
2015
		'CN32' => 'Xinjiang / &#26032;&#30086;',
2016
	);
2017
2018
	return apply_filters( 'give_chinese_states', $states );
2019
}
2020
2021
/**
2022
 * Get New Zealand States
2023
 *
2024
 * @since 1.0
2025
 * @return array $states A list of states
2026
 */
2027
function give_get_new_zealand_states_list() {
2028
	$states = array(
2029
		''   => '',
2030
		'AK' => 'Auckland',
2031
		'BP' => 'Bay of Plenty',
2032
		'CT' => 'Canterbury',
2033
		'HB' => 'Hawke&rsquo;s Bay',
2034
		'MW' => 'Manawatu-Wanganui',
2035
		'MB' => 'Marlborough',
2036
		'NS' => 'Nelson',
2037
		'NL' => 'Northland',
2038
		'OT' => 'Otago',
2039
		'SL' => 'Southland',
2040
		'TK' => 'Taranaki',
2041
		'TM' => 'Tasman',
2042
		'WA' => 'Waikato',
2043
		'WE' => 'Wellington',
2044
		'WC' => 'West Coast',
2045
	);
2046
2047
	return apply_filters( 'give_new_zealand_states', $states );
2048
}
2049
2050
/**
2051
 * Get Indonesian States
2052
 *
2053
 * @since 1.0
2054
 * @return array $states A list of states
2055
 */
2056
function give_get_indonesian_states_list() {
2057
	$states = array(
2058
		''   => '',
2059
		'AC' => 'Daerah Istimewa Aceh',
2060
		'SU' => 'Sumatera Utara',
2061
		'SB' => 'Sumatera Barat',
2062
		'RI' => 'Riau',
2063
		'KR' => 'Kepulauan Riau',
2064
		'JA' => 'Jambi',
2065
		'SS' => 'Sumatera Selatan',
2066
		'BB' => 'Bangka Belitung',
2067
		'BE' => 'Bengkulu',
2068
		'LA' => 'Lampung',
2069
		'JK' => 'DKI Jakarta',
2070
		'JB' => 'Jawa Barat',
2071
		'BT' => 'Banten',
2072
		'JT' => 'Jawa Tengah',
2073
		'JI' => 'Jawa Timur',
2074
		'YO' => 'Daerah Istimewa Yogyakarta',
2075
		'BA' => 'Bali',
2076
		'NB' => 'Nusa Tenggara Barat',
2077
		'NT' => 'Nusa Tenggara Timur',
2078
		'KB' => 'Kalimantan Barat',
2079
		'KT' => 'Kalimantan Tengah',
2080
		'KI' => 'Kalimantan Timur',
2081
		'KS' => 'Kalimantan Selatan',
2082
		'KU' => 'Kalimantan Utara',
2083
		'SA' => 'Sulawesi Utara',
2084
		'ST' => 'Sulawesi Tengah',
2085
		'SG' => 'Sulawesi Tenggara',
2086
		'SR' => 'Sulawesi Barat',
2087
		'SN' => 'Sulawesi Selatan',
2088
		'GO' => 'Gorontalo',
2089
		'MA' => 'Maluku',
2090
		'MU' => 'Maluku Utara',
2091
		'PA' => 'Papua',
2092
		'PB' => 'Papua Barat',
2093
	);
2094
2095
	return apply_filters( 'give_indonesia_states', $states );
2096
}
2097
2098
/**
2099
 * Get Indian States
2100
 *
2101
 * @since 1.0
2102
 * @return array $states A list of states
2103
 */
2104
function give_get_indian_states_list() {
2105
	$states = array(
2106
		''   => '',
2107
		'AP' => 'Andhra Pradesh',
2108
		'AR' => 'Arunachal Pradesh',
2109
		'AS' => 'Assam',
2110
		'BR' => 'Bihar',
2111
		'CT' => 'Chhattisgarh',
2112
		'GA' => 'Goa',
2113
		'GJ' => 'Gujarat',
2114
		'HR' => 'Haryana',
2115
		'HP' => 'Himachal Pradesh',
2116
		'JK' => 'Jammu and Kashmir',
2117
		'JH' => 'Jharkhand',
2118
		'KA' => 'Karnataka',
2119
		'KL' => 'Kerala',
2120
		'MP' => 'Madhya Pradesh',
2121
		'MH' => 'Maharashtra',
2122
		'MN' => 'Manipur',
2123
		'ML' => 'Meghalaya',
2124
		'MZ' => 'Mizoram',
2125
		'NL' => 'Nagaland',
2126
		'OR' => 'Orissa',
2127
		'PB' => 'Punjab',
2128
		'RJ' => 'Rajasthan',
2129
		'SK' => 'Sikkim',
2130
		'TN' => 'Tamil Nadu',
2131
		'TG' => 'Telangana',
2132
		'TR' => 'Tripura',
2133
		'UT' => 'Uttarakhand',
2134
		'UP' => 'Uttar Pradesh',
2135
		'WB' => 'West Bengal',
2136
		'AN' => 'Andaman and Nicobar Islands',
2137
		'CH' => 'Chandigarh',
2138
		'DN' => 'Dadar and Nagar Haveli',
2139
		'DD' => 'Daman and Diu',
2140
		'DL' => 'Delhi',
2141
		'LD' => 'Lakshadweep',
2142
		'PY' => 'Pondicherry (Puducherry)',
2143
	);
2144
2145
	return apply_filters( 'give_indian_states', $states );
2146
}
2147
2148
/**
2149
 * Get Malaysian States
2150
 *
2151
 * @since 1.6
2152
 * @return array $states A list of states
2153
 */
2154
function give_get_malaysian_states_list() {
2155
	$states = array(
2156
		''    => '',
2157
		'JHR' => 'Johor',
2158
		'KDH' => 'Kedah',
2159
		'KTN' => 'Kelantan',
2160
		'MLK' => 'Melaka',
2161
		'NSN' => 'Negeri Sembilan',
2162
		'PHG' => 'Pahang',
2163
		'PRK' => 'Perak',
2164
		'PLS' => 'Perlis',
2165
		'PNG' => 'Pulau Pinang',
2166
		'SBH' => 'Sabah',
2167
		'SWK' => 'Sarawak',
2168
		'SGR' => 'Selangor',
2169
		'TRG' => 'Terengganu',
2170
		'KUL' => 'W.P. Kuala Lumpur',
2171
		'LBN' => 'W.P. Labuan',
2172
		'PJY' => 'W.P. Putrajaya',
2173
	);
2174
2175
	return apply_filters( 'give_malaysian_states', $states );
2176
}
2177
2178
/**
2179
 * Get South African States
2180
 *
2181
 * @since 1.6
2182
 * @return array $states A list of states
2183
 */
2184
function give_get_south_african_states_list() {
2185
	$states = array(
2186
		''    => '',
2187
		'EC'  => 'Eastern Cape',
2188
		'FS'  => 'Free State',
2189
		'GP'  => 'Gauteng',
2190
		'KZN' => 'KwaZulu-Natal',
2191
		'LP'  => 'Limpopo',
2192
		'MP'  => 'Mpumalanga',
2193
		'NC'  => 'Northern Cape',
2194
		'NW'  => 'North West',
2195
		'WC'  => 'Western Cape',
2196
	);
2197
2198
	return apply_filters( 'give_south_african_states', $states );
2199
}
2200
2201
/**
2202
 * Get Thailand States
2203
 *
2204
 * @since 1.6
2205
 * @return array $states A list of states
2206
 */
2207
function give_get_thailand_states_list() {
2208
	$states = array(
2209
		''      => '',
2210
		'TH-37' => 'Amnat Charoen (&#3629;&#3635;&#3609;&#3634;&#3592;&#3648;&#3592;&#3619;&#3636;&#3597;)',
2211
		'TH-15' => 'Ang Thong (&#3629;&#3656;&#3634;&#3591;&#3607;&#3629;&#3591;)',
2212
		'TH-14' => 'Ayutthaya (&#3614;&#3619;&#3632;&#3609;&#3588;&#3619;&#3624;&#3619;&#3637;&#3629;&#3618;&#3640;&#3608;&#3618;&#3634;)',
2213
		'TH-10' => 'Bangkok (&#3585;&#3619;&#3640;&#3591;&#3648;&#3607;&#3614;&#3617;&#3627;&#3634;&#3609;&#3588;&#3619;)',
2214
		'TH-38' => 'Bueng Kan (&#3610;&#3638;&#3591;&#3585;&#3634;&#3628;)',
2215
		'TH-31' => 'Buri Ram (&#3610;&#3640;&#3619;&#3637;&#3619;&#3633;&#3617;&#3618;&#3660;)',
2216
		'TH-24' => 'Chachoengsao (&#3593;&#3632;&#3648;&#3594;&#3636;&#3591;&#3648;&#3607;&#3619;&#3634;)',
2217
		'TH-18' => 'Chai Nat (&#3594;&#3633;&#3618;&#3609;&#3634;&#3607;)',
2218
		'TH-36' => 'Chaiyaphum (&#3594;&#3633;&#3618;&#3616;&#3641;&#3617;&#3636;)',
2219
		'TH-22' => 'Chanthaburi (&#3592;&#3633;&#3609;&#3607;&#3610;&#3640;&#3619;&#3637;)',
2220
		'TH-50' => 'Chiang Mai (&#3648;&#3594;&#3637;&#3618;&#3591;&#3651;&#3627;&#3617;&#3656;)',
2221
		'TH-57' => 'Chiang Rai (&#3648;&#3594;&#3637;&#3618;&#3591;&#3619;&#3634;&#3618;)',
2222
		'TH-20' => 'Chonburi (&#3594;&#3621;&#3610;&#3640;&#3619;&#3637;)',
2223
		'TH-86' => 'Chumphon (&#3594;&#3640;&#3617;&#3614;&#3619;)',
2224
		'TH-46' => 'Kalasin (&#3585;&#3634;&#3628;&#3626;&#3636;&#3609;&#3608;&#3640;&#3660;)',
2225
		'TH-62' => 'Kamphaeng Phet (&#3585;&#3635;&#3649;&#3614;&#3591;&#3648;&#3614;&#3594;&#3619;)',
2226
		'TH-71' => 'Kanchanaburi (&#3585;&#3634;&#3597;&#3592;&#3609;&#3610;&#3640;&#3619;&#3637;)',
2227
		'TH-40' => 'Khon Kaen (&#3586;&#3629;&#3609;&#3649;&#3585;&#3656;&#3609;)',
2228
		'TH-81' => 'Krabi (&#3585;&#3619;&#3632;&#3610;&#3637;&#3656;)',
2229
		'TH-52' => 'Lampang (&#3621;&#3635;&#3611;&#3634;&#3591;)',
2230
		'TH-51' => 'Lamphun (&#3621;&#3635;&#3614;&#3641;&#3609;)',
2231
		'TH-42' => 'Loei (&#3648;&#3621;&#3618;)',
2232
		'TH-16' => 'Lopburi (&#3621;&#3614;&#3610;&#3640;&#3619;&#3637;)',
2233
		'TH-58' => 'Mae Hong Son (&#3649;&#3617;&#3656;&#3630;&#3656;&#3629;&#3591;&#3626;&#3629;&#3609;)',
2234
		'TH-44' => 'Maha Sarakham (&#3617;&#3627;&#3634;&#3626;&#3634;&#3619;&#3588;&#3634;&#3617;)',
2235
		'TH-49' => 'Mukdahan (&#3617;&#3640;&#3585;&#3604;&#3634;&#3627;&#3634;&#3619;)',
2236
		'TH-26' => 'Nakhon Nayok (&#3609;&#3588;&#3619;&#3609;&#3634;&#3618;&#3585;)',
2237
		'TH-73' => 'Nakhon Pathom (&#3609;&#3588;&#3619;&#3611;&#3600;&#3617;)',
2238
		'TH-48' => 'Nakhon Phanom (&#3609;&#3588;&#3619;&#3614;&#3609;&#3617;)',
2239
		'TH-30' => 'Nakhon Ratchasima (&#3609;&#3588;&#3619;&#3619;&#3634;&#3594;&#3626;&#3637;&#3617;&#3634;)',
2240
		'TH-60' => 'Nakhon Sawan (&#3609;&#3588;&#3619;&#3626;&#3623;&#3619;&#3619;&#3588;&#3660;)',
2241
		'TH-80' => 'Nakhon Si Thammarat (&#3609;&#3588;&#3619;&#3624;&#3619;&#3637;&#3608;&#3619;&#3619;&#3617;&#3619;&#3634;&#3594;)',
2242
		'TH-55' => 'Nan (&#3609;&#3656;&#3634;&#3609;)',
2243
		'TH-96' => 'Narathiwat (&#3609;&#3619;&#3634;&#3608;&#3636;&#3623;&#3634;&#3626;)',
2244
		'TH-39' => 'Nong Bua Lam Phu (&#3627;&#3609;&#3629;&#3591;&#3610;&#3633;&#3623;&#3621;&#3635;&#3616;&#3641;)',
2245
		'TH-43' => 'Nong Khai (&#3627;&#3609;&#3629;&#3591;&#3588;&#3634;&#3618;)',
2246
		'TH-12' => 'Nonthaburi (&#3609;&#3609;&#3607;&#3610;&#3640;&#3619;&#3637;)',
2247
		'TH-13' => 'Pathum Thani (&#3611;&#3607;&#3640;&#3617;&#3608;&#3634;&#3609;&#3637;)',
2248
		'TH-94' => 'Pattani (&#3611;&#3633;&#3605;&#3605;&#3634;&#3609;&#3637;)',
2249
		'TH-82' => 'Phang Nga (&#3614;&#3633;&#3591;&#3591;&#3634;)',
2250
		'TH-93' => 'Phatthalung (&#3614;&#3633;&#3607;&#3621;&#3640;&#3591;)',
2251
		'TH-56' => 'Phayao (&#3614;&#3632;&#3648;&#3618;&#3634;)',
2252
		'TH-67' => 'Phetchabun (&#3648;&#3614;&#3594;&#3619;&#3610;&#3641;&#3619;&#3603;&#3660;)',
2253
		'TH-76' => 'Phetchaburi (&#3648;&#3614;&#3594;&#3619;&#3610;&#3640;&#3619;&#3637;)',
2254
		'TH-66' => 'Phichit (&#3614;&#3636;&#3592;&#3636;&#3605;&#3619;)',
2255
		'TH-65' => 'Phitsanulok (&#3614;&#3636;&#3625;&#3603;&#3640;&#3650;&#3621;&#3585;)',
2256
		'TH-54' => 'Phrae (&#3649;&#3614;&#3619;&#3656;)',
2257
		'TH-83' => 'Phuket (&#3616;&#3641;&#3648;&#3585;&#3655;&#3605;)',
2258
		'TH-25' => 'Prachin Buri (&#3611;&#3619;&#3634;&#3592;&#3637;&#3609;&#3610;&#3640;&#3619;&#3637;)',
2259
		'TH-77' => 'Prachuap Khiri Khan (&#3611;&#3619;&#3632;&#3592;&#3623;&#3610;&#3588;&#3637;&#3619;&#3637;&#3586;&#3633;&#3609;&#3608;&#3660;)',
2260
		'TH-85' => 'Ranong (&#3619;&#3632;&#3609;&#3629;&#3591;)',
2261
		'TH-70' => 'Ratchaburi (&#3619;&#3634;&#3594;&#3610;&#3640;&#3619;&#3637;)',
2262
		'TH-21' => 'Rayong (&#3619;&#3632;&#3618;&#3629;&#3591;)',
2263
		'TH-45' => 'Roi Et (&#3619;&#3657;&#3629;&#3618;&#3648;&#3629;&#3655;&#3604;)',
2264
		'TH-27' => 'Sa Kaeo (&#3626;&#3619;&#3632;&#3649;&#3585;&#3657;&#3623;)',
2265
		'TH-47' => 'Sakon Nakhon (&#3626;&#3585;&#3621;&#3609;&#3588;&#3619;)',
2266
		'TH-11' => 'Samut Prakan (&#3626;&#3617;&#3640;&#3607;&#3619;&#3611;&#3619;&#3634;&#3585;&#3634;&#3619;)',
2267
		'TH-74' => 'Samut Sakhon (&#3626;&#3617;&#3640;&#3607;&#3619;&#3626;&#3634;&#3588;&#3619;)',
2268
		'TH-75' => 'Samut Songkhram (&#3626;&#3617;&#3640;&#3607;&#3619;&#3626;&#3591;&#3588;&#3619;&#3634;&#3617;)',
2269
		'TH-19' => 'Saraburi (&#3626;&#3619;&#3632;&#3610;&#3640;&#3619;&#3637;)',
2270
		'TH-91' => 'Satun (&#3626;&#3605;&#3641;&#3621;)',
2271
		'TH-17' => 'Sing Buri (&#3626;&#3636;&#3591;&#3627;&#3660;&#3610;&#3640;&#3619;&#3637;)',
2272
		'TH-33' => 'Sisaket (&#3624;&#3619;&#3637;&#3626;&#3632;&#3648;&#3585;&#3625;)',
2273
		'TH-90' => 'Songkhla (&#3626;&#3591;&#3586;&#3621;&#3634;)',
2274
		'TH-64' => 'Sukhothai (&#3626;&#3640;&#3650;&#3586;&#3607;&#3633;&#3618;)',
2275
		'TH-72' => 'Suphan Buri (&#3626;&#3640;&#3614;&#3619;&#3619;&#3603;&#3610;&#3640;&#3619;&#3637;)',
2276
		'TH-84' => 'Surat Thani (&#3626;&#3640;&#3619;&#3634;&#3625;&#3598;&#3619;&#3660;&#3608;&#3634;&#3609;&#3637;)',
2277
		'TH-32' => 'Surin (&#3626;&#3640;&#3619;&#3636;&#3609;&#3607;&#3619;&#3660;)',
2278
		'TH-63' => 'Tak (&#3605;&#3634;&#3585;)',
2279
		'TH-92' => 'Trang (&#3605;&#3619;&#3633;&#3591;)',
2280
		'TH-23' => 'Trat (&#3605;&#3619;&#3634;&#3604;)',
2281
		'TH-34' => 'Ubon Ratchathani (&#3629;&#3640;&#3610;&#3621;&#3619;&#3634;&#3594;&#3608;&#3634;&#3609;&#3637;)',
2282
		'TH-41' => 'Udon Thani (&#3629;&#3640;&#3604;&#3619;&#3608;&#3634;&#3609;&#3637;)',
2283
		'TH-61' => 'Uthai Thani (&#3629;&#3640;&#3607;&#3633;&#3618;&#3608;&#3634;&#3609;&#3637;)',
2284
		'TH-53' => 'Uttaradit (&#3629;&#3640;&#3605;&#3619;&#3604;&#3636;&#3605;&#3606;&#3660;)',
2285
		'TH-95' => 'Yala (&#3618;&#3632;&#3621;&#3634;)',
2286
		'TH-35' => 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)',
2287
	);
2288
2289
	return apply_filters( 'give_thailand_states', $states );
2290
}
2291
2292
/**
2293
 * Get Spain States
2294
 *
2295
 * @since 1.0
2296
 * @return array $states A list of states
2297
 */
2298
function give_get_spain_states_list() {
2299
	$states = array(
2300
		''   => '',
2301
		'C'  => esc_html__( 'A Coru&ntilde;a', 'give' ),
2302
		'VI' => esc_html__( 'Álava', 'give' ),
2303
		'AB' => esc_html__( 'Albacete', 'give' ),
2304
		'A'  => esc_html__( 'Alicante', 'give' ),
2305
		'AL' => esc_html__( 'Almer&iacute;a', 'give' ),
2306
		'O'  => esc_html__( 'Asturias', 'give' ),
2307
		'AV' => esc_html__( '&Aacute;vila', 'give' ),
2308
		'BA' => esc_html__( 'Badajoz', 'give' ),
2309
		'PM' => esc_html__( 'Baleares', 'give' ),
2310
		'B'  => esc_html__( 'Barcelona', 'give' ),
2311
		'BU' => esc_html__( 'Burgos', 'give' ),
2312
		'CC' => esc_html__( 'C&aacute;ceres', 'give' ),
2313
		'CA' => esc_html__( 'C&aacute;diz', 'give' ),
2314
		'S'  => esc_html__( 'Cantabria', 'give' ),
2315
		'CS' => esc_html__( 'Castell&oacute;n', 'give' ),
2316
		'CE' => esc_html__( 'Ceuta', 'give' ),
2317
		'CR' => esc_html__( 'Ciudad Real', 'give' ),
2318
		'CO' => esc_html__( 'C&oacute;rdoba', 'give' ),
2319
		'CU' => esc_html__( 'Cuenca', 'give' ),
2320
		'GI' => esc_html__( 'Girona', 'give' ),
2321
		'GR' => esc_html__( 'Granada', 'give' ),
2322
		'GU' => esc_html__( 'Guadalajara', 'give' ),
2323
		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
2324
		'H'  => esc_html__( 'Huelva', 'give' ),
2325
		'HU' => esc_html__( 'Huesca', 'give' ),
2326
		'J'  => esc_html__( 'Ja&eacute;n', 'give' ),
2327
		'LO' => esc_html__( 'La Rioja', 'give' ),
2328
		'GC' => esc_html__( 'Las Palmas', 'give' ),
2329
		'LE' => esc_html__( 'Le&oacute;n', 'give' ),
2330
		'L'  => esc_html__( 'Lleida', 'give' ),
2331
		'LU' => esc_html__( 'Lugo', 'give' ),
2332
		'M'  => esc_html__( 'Madrid', 'give' ),
2333
		'MA' => esc_html__( 'M&aacute;laga', 'give' ),
2334
		'ML' => esc_html__( 'Melilla', 'give' ),
2335
		'MU' => esc_html__( 'Murcia', 'give' ),
2336
		'NA' => esc_html__( 'Navarra', 'give' ),
2337
		'OR' => esc_html__( 'Ourense', 'give' ),
2338
		'P'  => esc_html__( 'Palencia', 'give' ),
2339
		'PO' => esc_html__( 'Pontevedra', 'give' ),
2340
		'SA' => esc_html__( 'Salamanca', 'give' ),
2341
		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
2342
		'SG' => esc_html__( 'Segovia', 'give' ),
2343
		'SE' => esc_html__( 'Sevilla', 'give' ),
2344
		'SO' => esc_html__( 'Soria', 'give' ),
2345
		'T'  => esc_html__( 'Tarragona', 'give' ),
2346
		'TE' => esc_html__( 'Teruel', 'give' ),
2347
		'TO' => esc_html__( 'Toledo', 'give' ),
2348
		'V'  => esc_html__( 'Valencia', 'give' ),
2349
		'VA' => esc_html__( 'Valladolid', 'give' ),
2350
		'BI' => esc_html__( 'Bizkaia', 'give' ),
2351
		'ZA' => esc_html__( 'Zamora', 'give' ),
2352
		'Z'  => esc_html__( 'Zaragoza', 'give' ),
2353
	);
2354
2355
	return apply_filters( 'give_spain_states', $states );
2356
}
2357