-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.php
419 lines (346 loc) · 15.1 KB
/
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*
*/
function optionsframework_option_name() {
// This gets the theme name from the stylesheet
$themename = wp_get_theme();
$themename = preg_replace("/\W/", "_", strtolower($themename) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $themename;
update_option( 'optionsframework', $optionsframework_settings );
}
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the 'id' fields, make sure to use all lowercase and no spaces.
*
*/
function optionsframework_options() {
// Layout options
$site_layout = array('pull-left' => __('Right Sidebar', 'dazzling'),'pull-right' => __('Left Sidebar', 'dazzling'));
// Test data
$test_array = array(
'one' => __('One', 'options_framework_theme'),
'two' => __('Two', 'options_framework_theme'),
'three' => __('Three', 'options_framework_theme'),
'four' => __('Four', 'options_framework_theme'),
'five' => __('Five', 'options_framework_theme')
);
// Multicheck Array
$multicheck_array = array(
'one' => __('French Toast', 'options_framework_theme'),
'two' => __('Pancake', 'options_framework_theme'),
'three' => __('Omelette', 'options_framework_theme'),
'four' => __('Crepe', 'options_framework_theme'),
'five' => __('Waffle', 'options_framework_theme')
);
// Multicheck Defaults
$multicheck_defaults = array(
'one' => '1',
'five' => '1'
);
// Typography Defaults
$typography_defaults = array(
'size' => '14px',
'face' => 'Helvetica Neue',
'style' => 'normal',
'color' => '#6B6B6B' );
// Typography Options
$typography_options = array(
'sizes' => array( '6','10','12','14','15','16','18','20','24','28','32','36','42','48' ),
'faces' => array( 'arial' => 'Arial',
'verdana' => 'Verdana, Geneva',
'trebuchet' => 'Trebuchet',
'georgia' => 'Georgia',
'times' => 'Times New Roman',
'tahoma' => 'Tahoma, Geneva',
'palatino' => 'Palatino',
'helvetica' => 'Helvetica',
'Helvetica Neue' => 'Helvetica Neue'
),
'styles' => array( 'normal' => 'Normal','bold' => 'Bold' ),
'color' => true
);
// $radio = array('0' => __('No', 'dazzling'),'1' => __('Yes', 'dazzling'));
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all tags into an array
$options_tags = array();
$options_tags_obj = get_tags();
foreach ( $options_tags_obj as $tag ) {
$options_tags[$tag->term_id] = $tag->name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
// Pull all the pages into an array
// $options_slider = array();
// $options_slider_obj = get_posts('post_type=custom_slider');
// $options_slider[''] = 'Select a slider:';
// foreach ($options_slider_obj as $post) {
// $options_slider[$post->ID] = $post->post_title;
// }
// If using image radio buttons, define a directory path
$imagepath = get_template_directory_uri() . '/images/';
// fixed or scroll position
$fixed_scroll = array('scroll' => 'Scroll', 'fixed' => 'Fixed');
$options = array();
$options[] = array( 'name' => __('Main', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Do You want to display image slider on the Home Page?','dazzling'),
'desc' => __('Check if you want to enable slider', 'dazzling'),
'id' => 'dazzling_slider_checkbox',
'std' => 1,
'type' => 'checkbox');
$options[] = array( 'name' => __('Slider Category', 'dazzling'),
'desc' => __('Select a category for the featured post slider', 'dazzling'),
'id' => 'dazzling_slide_categories',
'type' => 'select',
'class' => 'hidden',
'options' => $options_categories);
$options[] = array( 'name' => __('Number of slide items', 'dazzling'),
'desc' => __('Enter the number of slide items', 'dazzling'),
'id' => 'dazzling_slide_number',
'std' => '3',
'class' => 'hidden',
'type' => 'text');
$options[] = array( 'name' => __('Website Layout Options', 'dazzling'),
'desc' => __('Choose between Left and Right sidebar options to be used as default', 'dazzling'),
'id' => 'site_layout',
'std' => 'pull-left',
'type' => 'select',
'class' => 'mini',
'options' => $site_layout);
$options[] = array( 'name' => __('Element color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'element_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Element color on hover', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'element_color_hover',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Custom Favicon', 'dazzling'),
'desc' => __('Upload a 32px x 32px PNG/GIF image that will represent your websites favicon', 'dazzling'),
'id' => 'custom_favicon',
'std' => '',
'type' => 'upload');
$options[] = array( 'name' => __('Action Button', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Call For Action Text', 'dazzling'),
'desc' => __('Enter the text for call for action section', 'dazzling'),
'id' => 'w2f_cfa_text',
'std' => '',
'type' => 'textarea');
$options[] = array( 'name' => __('Call For Action Button Title', 'dazzling'),
'desc' => __('Enter the title for Call For Action button', 'dazzling'),
'id' => 'w2f_cfa_button',
'std' => '',
'type' => 'text');
$options[] = array( 'name' => __('CFA button link', 'dazzling'),
'desc' => __('Enter the link for Call For Action button', 'dazzling'),
'id' => 'w2f_cfa_link',
'std' => '',
'type' => 'text');
$options[] = array( 'name' => __('Call For Action Text Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'cfa_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Call For Action Background Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'cfa_bg_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Call For Action Button Border Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'cfa_btn_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Call For Action Button Text Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'cfa_btn_txt_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Typography', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Main Body Text', 'dazzling'),
'desc' => __('Used in P tags', 'dazzling'),
'id' => 'main_body_typography',
'std' => $typography_defaults,
'type' => 'typography',
'options' => $typography_options);
$options[] = array( 'name' => __('Heading Color', 'dazzling'),
'desc' => __('Color for all headings (h1-h6)', 'dazzling'),
'id' => 'heading_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Link Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'link_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Link:hover Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'link_hover_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Link:active Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'link_active_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Header', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Top nav background color', 'dazzling'),
'desc' => __('Default used if no color is selected.', 'dazzling'),
'id' => 'top_nav_bg_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Top nav item color', 'dazzling'),
'desc' => __('Link color', 'dazzling'),
'id' => 'top_nav_link_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Top nav dropdown background color', 'dazzling'),
'desc' => __('Background of dropdown item hover color', 'dazzling'),
'id' => 'top_nav_dropdown_bg',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Top nav dropdown item color', 'dazzling'),
'desc' => __('Dropdown item color', 'dazzling'),
'id' => 'top_nav_dropdown_item',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Footer', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Footer Widget Area Background Color', 'dazzling'),
'id' => 'footer_widget_bg_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Footer Background Color', 'dazzling'),
'id' => 'footer_bg_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Footer Text Color', 'dazzling'),
'id' => 'footer_text_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Footer Link Color', 'dazzling'),
'id' => 'footer_link_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Footer information', 'dazzling'),
'desc' => __('Copyright text in footer', 'dazzling'),
'id' => 'custom_footer_text',
'std' => '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" >' . get_bloginfo( 'name', 'display' ) . '</a> '. __('All rights reserved.', 'dazzling'),
'type' => 'textarea');
$options[] = array( 'name' => __('Social', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Social Icon Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'social_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Social Icon:hover Color', 'dazzling'),
'desc' => __('Default used if no color is selected', 'dazzling'),
'id' => 'social_hover_color',
'std' => '',
'type' => 'color');
$options[] = array( 'name' => __('Add full URL for your social network profiles', 'dazzling'),
'desc' => __('Facebook', 'dazzling'),
'id' => 'social_facebook',
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_twitter',
'desc' => __('Twitter', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_googleplus',
'desc' => __('Google+', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_youtube',
'desc' => __('Youtube', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_linkedin',
'desc' => __('LinkedIn', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_pinterest',
'desc' => __('Pinterest', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_rss',
'desc' => __('RSS Feed', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_tumblr',
'desc' => __('Tumblr', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_flickr',
'desc' => __('Flickr', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_instagram',
'desc' => __('Instagram', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_dribbble',
'desc' => __('Dribbble', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_skype',
'desc' => __('Skype', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_github',
'desc' => __('Github', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_slideshare',
'desc' => __('Slideshare', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'id' => 'social_vk',
'desc' => __('VK.com', 'dazzling'),
'std' => '',
'class' => 'mini',
'type' => 'text');
$options[] = array( 'name' => __('Other', 'dazzling'),
'type' => 'heading');
$options[] = array( 'name' => __('Custom CSS', 'dazzling'),
'desc' => __('Additional CSS', 'dazzling'),
'id' => 'custom_css',
'std' => '',
'type' => 'textarea');
return $options;
}