-
Notifications
You must be signed in to change notification settings - Fork 0
/
wc-colombia-states.php
63 lines (59 loc) · 1.4 KB
/
wc-colombia-states.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
<?php
/*
Plugin Name: WC Colombia States
Plugin URI:
Description: Add Colombian states to WooCommerce
Version: 1.0
Author: @hachesilva
Author URI: http://hachesilva.com
License: GPL2
*/
/*
* Die if the file is accessed directly
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
/*
* Check if WooCommerce is active
*/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
add_filter( 'woocommerce_states', 'wc_colombia_states' );
function wc_colombia_states( $states ) {
$states['CO'] = array(
'AMA' => 'Amazonas',
'ANT' => 'Antioquia',
'ARA' => 'Arauca',
'ATL' => 'Atlántico',
'BOL' => 'Bolívar',
'BOY' => 'Boyacá',
'CAL' => 'Caldas',
'CAQ' => 'Caquetá',
'CAS' => 'Casanare',
'CAU' => 'Cauca',
'CES' => 'Cesar',
'CHO' => 'Chocó',
'COR' => 'Córdoba',
'CUN' => 'Cundinamarca',
'GUA' => 'Guainía',
'GUV' => 'Guaviare',
'HUI' => 'Huila',
'LAG' => 'La Guajira',
'MAG' => 'Magdalena',
'MET' => 'Meta',
'NAR' => 'Nariño',
'NSA' => 'Norte de Santander',
'PUT' => 'Putumayo',
'QUI' => 'Quindio',
'RIS' => 'Risaralda',
'SAP' => 'San Andrés y Providencia',
'SAN' => 'Santander',
'SUC' => 'Sucre',
'TOL' => 'Tolima',
'VAC' => 'Valle del Cauca',
'VAU' => 'Vaupés',
'VID' => 'Vichada'
);
return $states;
}
}