-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwoocommerce-uk-counties.php
142 lines (135 loc) · 6.8 KB
/
woocommerce-uk-counties.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
/*
Plugin Name: UK Counties for WooCommerce
Plugin URI: http://plugins.leewillis.co.uk/donate/
Description: A short plugin that adds UK postal counties to WooCommerce's list of states.
Version: 1.2
Author: Lee Willis
Author URI: http://plugins.leewillis.co.uk/
*/
/**
* Copyright (c) 2012 Lee Willis. All rights reserved.
*
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*
* This is an add-on for WordPress
* http://wordpress.org/
*
* **********************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* **********************************************************************
*/
function wc_uk_counties_add_counties( $states ) {
$states['GB'] = array(
'AV' => 'Avon',
'BE' => 'Bedfordshire',
'BK' => 'Berkshire',
'BU' => 'Buckinghamshire',
'CA' => 'Cambridgeshire',
'CH' => 'Cheshire',
'CL' => 'Cleveland',
'CO' => 'Cornwall',
'CD' => 'County Durham',
'CU' => 'Cumbria',
'DE' => 'Derbyshire',
'DV' => 'Devon',
'DO' => 'Dorset',
'ES' => 'East Sussex',
'EX' => 'Essex',
'GL' => 'Gloucestershire',
'HA' => 'Hampshire',
'HE' => 'Herefordshire',
'HT' => 'Hertfordshire',
'IW' => 'Isle of Wight',
'KE' => 'Kent',
'LA' => 'Lancashire',
'LE' => 'Leicestershire',
'LI' => 'Lincolnshire',
'LO' => 'London',
'ME' => 'Merseyside',
'MI' => 'Middlesex',
'NO' => 'Norfolk',
'NH' => 'North Humberside',
'NY' => 'North Yorkshire',
'NS' => 'Northamptonshire',
'NL' => 'Northumberland',
'NT' => 'Nottinghamshire',
'OX' => 'Oxfordshire',
'SH' => 'Shropshire',
'SO' => 'Somerset',
'SM' => 'South Humberside',
'SY' => 'South Yorkshire',
'SF' => 'Staffordshire',
'SU' => 'Suffolk',
'SR' => 'Surrey',
'TW' => 'Tyne and Wear',
'WA' => 'Warwickshire',
'WM' => 'West Midlands',
'WS' => 'West Sussex',
'WY' => 'West Yorkshire',
'WI' => 'Wiltshire',
'WO' => 'Worcestershire',
'ABD' => 'Scotland / Aberdeenshire',
'ANS' => 'Scotland / Angus',
'ARL' => 'Scotland / Argyle & Bute',
'AYR' => 'Scotland / Ayrshire',
'CLK' => 'Scotland / Clackmannanshire',
'DGY' => 'Scotland / Dumfries & Galloway',
'DNB' => 'Scotland / Dunbartonshire',
'DDE' => 'Scotland / Dundee',
'ELN' => 'Scotland / East Lothian',
'EDB' => 'Scotland / Edinburgh',
'FIF' => 'Scotland / Fife',
'GGW' => 'Scotland / Glasgow',
'HLD' => 'Scotland / Highland',
'LKS' => 'Scotland / Lanarkshire',
'MLN' => 'Scotland / Midlothian',
'MOR' => 'Scotland / Moray',
'OKI' => 'Scotland / Orkney',
'PER' => 'Scotland / Perth and Kinross',
'RFW' => 'Scotland / Renfrewshire',
'SB' => 'Scotland / Scottish Borders',
'SHI' => 'Scotland / Shetland Isles',
'STI' => 'Scotland / Stirling',
'WLN' => 'Scotland / West Lothian',
'WIS' => 'Scotland / Western Isles',
'AGY' => 'Wales / Anglesey',
'GNT' => 'Wales / Blaenau Gwent',
'CP' => 'Wales / Caerphilly',
'CF' => 'Wales / Cardiff',
'CAE' => 'Wales / Carmarthenshire',
'CR' => 'Wales / Ceredigion',
'CW' => 'Wales / Conwy',
'DEN' => 'Wales / Denbighshire',
'FLN' => 'Wales / Flintshire',
'GLA' => 'Wales / Glamorgan',
'GWN' => 'Wales / Gwynedd',
'MT' => 'Wales / Merthyr Tydfil',
'MON' => 'Wales / Monmouthshire',
'PT' => 'Wales / Neath Port Talbot',
'NP' => 'Wales / Newport',
'PEM' => 'Wales / Pembrokeshire',
'POW' => 'Wales / Powys',
'RT' => 'Wales / Rhondda Cynon Taff',
'SS' => 'Wales / Swansea',
'TF' => 'Wales / Torfaen',
'WX' => 'Wales / Wrexham',
'ANT' => 'Northern Ireland / County Antrim',
'ARM' => 'Northern Ireland / County Armagh',
'DOW' => 'Northern Ireland / County Down',
'FER' => 'Northern Ireland / County Fermanagh',
'LDY' => 'Northern Ireland / County Londonderry',
'TYR' => 'Northern Ireland / County Tyrone',
);
return $states;
}
add_filter( 'woocommerce_states', 'wc_uk_counties_add_counties' );