-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy paththeme-options.php
executable file
·217 lines (213 loc) · 6.21 KB
/
theme-options.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
/**
* Initialize the options before anything else.
*/
add_action( 'admin_init', 'everal_theme_options', 1 );
/**
* Build the custom settings & update OptionTree.
*/
function everal_theme_options() {
/**
* Get a copy of the saved settings array.
*/
$saved_settings = get_option( 'option_tree_settings', array() );
/**
* Custom settings array that will eventually be
* passes to the OptionTree Settings API Class.
*/
$everal_settings = array(
'sections' => array(
array(
'id' => 'general',
'title' => 'General'
),
array(
'id' => 'fonts',
'title' => 'Fonts'
)
),
'settings' => array(
array(
'id' => 'website_logo',
'label' => __( 'Website logo', 'everal' ),
'desc' => sprintf( __( 'Please upload your logo.', 'everal' ), apply_filters( 'ot_upload_text', __( 'Send to OptionTree', 'everal' ) ), 'FTP' ),
'std' => '',
'type' => 'upload',
'section' => 'general',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step' => '',
'class' => '',
'condition' => '',
'operator' => 'and'
),
array(
'id' => 'copyright_text',
'label' => __( 'Copyright', 'everal' ),
'desc' => __( 'Please provide short copyright text which will be shown in footer.', 'everal' ),
'std' => '',
'type' => 'text',
'section' => 'general',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step'=> '',
'class' => '',
'condition' => '',
'operator' => 'and'
),
array(
'id' => 'show__scroll_to_top__button',
'label' => __( 'Show "Scroll to Top" button', 'everal' ),
'desc' => __( 'Do you want to show "Scroll to Top" button?', 'everal' ),
'std' => 'false',
'type' => 'checkbox',
'section' => 'general',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step' => '',
'class' => '',
'condition' => '',
'operator' => 'and',
'choices' => array(
array(
'value' => 'true',
'label' => __( 'Show', 'everal' ),
'src' => ''
)
)
),
array(
'id' => 'favicon',
'label' => __( 'Favicon', 'everal' ),
'desc' => sprintf( __( 'Do you have favicon?', 'everal' ), apply_filters( 'ot_upload_text', __( 'Send to OptionTree', 'everal' ) ), 'FTP' ),
'std' => '',
'type' => 'upload',
'section' => 'general',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step' => '',
'class' => '',
'condition' => '',
'operator' => 'and'
),
array(
'id' => 'everal_layout_style',
'label' => 'Layout',
'desc' => 'Choose a layout for your theme',
'std' => 'full',
'type' => 'radio-image',
'section' => 'general',
'class' => '',
'choices' => array(
array(
'value' => 'left',
'label' => 'Left Sidebar',
'src' => OT_URL . '/assets/images/layout/left-sidebar.png'
),
array(
'value' => 'full',
'label' => 'Full Width (no sidebar)',
'src' => OT_URL . '/assets/images/layout/full-width.png'
),
array(
'value' => 'right',
'label' => 'Right Sidebar',
'src' => OT_URL . '/assets/images/layout/right-sidebar.png'
)
)
),
array(
'id' => 'google_font_roboto',
'label' => __( 'Roboto font', 'everal' ),
'desc' => __( 'If there are characters in your language that are not supported by Roboto, disable this option.', 'everal' ),
'std' => 'on',
'type' => 'on-off',
'section' => 'fonts',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step' => '',
'class' => '',
'condition' => '',
'operator' => 'and',
'choices' => array(
array(
'value' => 'off',
'label' => __( 'Disable', 'everal' ),
'src' => ''
)
)
),
array(
'id' => 'google_font_roboto_slab',
'label' => __( 'Roboto Slab font', 'everal' ),
'desc' => __( 'If there are characters in your language that are not supported by Roboto Slab, disable this option.', 'everal' ),
'std' => 'on',
'type' => 'on-off',
'section' => 'fonts',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step' => '',
'class' => '',
'condition' => '',
'operator' => 'and',
'choices' => array(
array(
'value' => 'off',
'label' => __( 'Disable', 'everal' ),
'src' => ''
)
)
),
array(
'id' => 'google_font_open_sans',
'label' => __( 'Open Sans font', 'everal' ),
'desc' => __( 'If there are characters in your language that are not supported by Open Sans, disable this option.', 'everal' ),
'std' => 'on',
'type' => 'on-off',
'section' => 'fonts',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'min_max_step' => '',
'class' => '',
'condition' => '',
'operator' => 'and',
'choices' => array(
array(
'value' => 'off',
'label' => __( 'Disable', 'everal' ),
'src' => ''
)
)
),
array(
'id' => 'large_logo_font_size',
'label' => __( 'Large logo font size', 'everal' ),
'desc' => __( 'Set the font size for main logo.', 'everal' ),
'std' => '50',
'type' => 'numeric-slider',
'section' => 'fonts',
'min_max_step' => '10,80,1'
),
array(
'id' => 'scrolled_logo_font_size',
'label' => __( 'Scrolled logo font size', 'everal' ),
'desc' => __( 'Set the font size for main logo when the page is scrolled.', 'everal' ),
'std' => '34',
'type' => 'numeric-slider',
'section' => 'fonts',
'min_max_step' => '10,80,1'
)
)
);
/* settings are not the same update the DB */
if ( $saved_settings !== $everal_settings ) {
update_option( 'option_tree_settings', $everal_settings );
}
}