-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions-theme-options-contact-infos.php
149 lines (143 loc) · 6.17 KB
/
functions-theme-options-contact-infos.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
143
144
145
146
147
148
149
<?php
// THEME OPTIONS - CONTACT INFOS
function lightwords_customize_register_contact_infos($wp_customize)
{
// Sections
$wp_customize->add_section('lightwords_contact_infos', array(
'title' => __('Contact infos', 'theme'),
'description' => __('Site-wied contact infos: address, phone number, opening hours...'),
'priority' => 6000,
'capability' => 'edit_theme_options',
));
// Settings
$wp_customize->add_setting('lw_contact_infos', array('default' => true, 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_addressFirmName', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_address1', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_address2', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_addressZipcode', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_addressCity', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_addressCountry', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_phone1', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_phone2', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_fax', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_opening', array('default' => true, 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_opening1', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_opening2', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_opening3', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_email', array('default' => "", 'transport' => 'refresh'));
$wp_customize->add_setting('lw_contact_infos_linkToContactPage', array('default' => true, 'transport' => 'refresh'));
// Controls
$wp_customize->add_control('lw_contact_infos', array(
'type' => 'checkbox',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Contact infos'),
'description' => __('Enable contact infos'),
));
$wp_customize->add_control('lw_contact_infos_addressFirmName', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Firm name'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_address1', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Address line 1'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_address2', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Address line 2'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_addressZipcode', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Zip code'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_addressCity', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('City'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_addressCountry', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Country'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_phone1', array(
'type' => 'number',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Phone 1'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_phone2', array(
'type' => 'number',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Phone 2'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_fax', array(
'type' => 'number',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Fax'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_opening', array(
'type' => 'checkbox',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Opening'),
'description' => __('Enable opening hours'),
));
$wp_customize->add_control('lw_contact_infos_opening1', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Opening hours 1'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_opening2', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Opening hours 2'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_opening3', array(
'type' => 'text',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Opening hours 3'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_email', array(
'type' => 'email',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Email'),
'description' => __(''),
));
$wp_customize->add_control('lw_contact_infos_linkToContactPage', array(
'type' => 'checkbox',
'priority' => 1,
'section' => 'lightwords_contact_infos',
'label' => __('Link to contact page'),
'description' => __(''),
));
}
add_action('customize_register', 'lightwords_customize_register_contact_infos');