-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme-options.php
More file actions
1143 lines (1078 loc) · 42.7 KB
/
theme-options.php
File metadata and controls
1143 lines (1078 loc) · 42.7 KB
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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*
*
* Require the framework class before doing anything else, so we can use the defined urls and dirs
* Also if running on windows you may have url problems, which can be fixed by defining the framework url first
*
*/
//define('NHP_OPTIONS_URL', site_url('path the options folder'));
if(!class_exists('NHP_Options')){
require_once( dirname( __FILE__ ) . '/options/options.php' );
}
/*
*
* Custom function for filtering the sections array given by theme, good for child themes to override or add to the sections.
* Simply include this function in the child themes functions.php file.
*
* NOTE: the defined constansts for urls, and dir will NOT be available at this point in a child theme, so you must use
* get_template_directory_uri() if you want to use any of the built in icons
*
*/
function add_another_section($sections){
//$sections = array();
$sections[] = array(
'title' => __('A Section added by hook', 'nhp-opts'),
'desc' => __('<p class="description">This is a section created by adding a filter to the sections array, great to allow child themes, to add/remove sections from the options.</p>', 'nhp-opts'),
//all the glyphicons are included in the options folder, so you can hook into them, or link to your own custom ones.
//You dont have to though, leave it blank for default.
'icon' => trailingslashit(get_template_directory_uri()).'options/img/glyphicons/glyphicons_062_attach.png',
//Lets leave this as a blank section, no options just some intro text set above.
'fields' => array()
);
return $sections;
}//function
//add_filter('nhp-opts-sections-twenty_eleven', 'add_another_section');
/*
*
* Custom function for filtering the args array given by theme, good for child themes to override or add to the args array.
*
*/
function change_framework_args($args){
//$args['dev_mode'] = false;
return $args;
}//function
//add_filter('nhp-opts-args-twenty_eleven', 'change_framework_args');
/*
* This is the meat of creating the optons page
*
* Override some of the default values, uncomment the args and change the values
* - no $args are required, but there there to be over ridden if needed.
*
*
*/
function setup_framework_options(){
$args = array();
//Set it to dev mode to view the class settings/info in the form - default is false
//$args['dev_mode'] = true;
//google api key MUST BE DEFINED IF YOU WANT TO USE GOOGLE WEBFONTS
//$args['google_api_key'] = '***';
//Remove the default stylesheet? make sure you enqueue another one all the page will look whack!
//$args['stylesheet_override'] = true;
//Add HTML before the form
$args['intro_text'] = __('<p>This is the HTML which can be displayed before the form, it isnt required, but more info is always better. Anything goes in terms of markup here, any HTML.</p>', 'nhp-opts');
//Setup custom links in the footer for share icons
$args['share_icons']['twitter'] = array(
'link' => 'http://twitter.com/teamglio',
'title' => 'Folow @teamglio on Twitter',
'img' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_322_twitter.png'
);
//Choose to disable the import/export feature
//$args['show_import_export'] = false;
//Choose a custom option name for your theme options, the default is the theme name in lowercase with spaces replaced by underscores
$args['opt_name'] = 'glio';
//Custom menu icon
$args['menu_icon'] = '';
//Custom menu title for options page - default is "Options"
$args['menu_title'] = __('Theme Options', 'nhp-opts');
//Custom Page Title for options page - default is "Options"
$args['page_title'] = __('Glio Digital Innovations', 'nhp-opts');
//Custom page slug for options page (wp-admin/themes.php?page=***) - default is "nhp_theme_options"
$args['page_slug'] = 'theme_options';
//Custom page capability - default is set to "manage_options"
//$args['page_cap'] = 'manage_options';
//page type - "menu" (adds a top menu section) or "submenu" (adds a submenu) - default is set to "menu"
//$args['page_type'] = 'submenu';
//parent menu - default is set to "themes.php" (Appearance)
//the list of available parent menus is available here: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
//$args['page_parent'] = 'themes.php';
//custom page location - default 100 - must be unique or will override other items
$args['page_position'] = 27;
//Custom page icon class (used to override the page icon next to heading)
//$args['page_icon'] = 'icon-themes';
//Want to disable the sections showing as a submenu in the admin? uncomment this line
//$args['allow_sub_menu'] = false;
//Set ANY custom page help tabs - displayed using the new help tab API, show in order of definition
$args['help_tabs'][] = array(
'id' => 'nhp-opts-1',
'title' => __('Theme Information 1', 'nhp-opts'),
'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'nhp-opts')
);
$args['help_tabs'][] = array(
'id' => 'nhp-opts-2',
'title' => __('Theme Information 2', 'nhp-opts'),
'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'nhp-opts')
);
//Set the Help Sidebar for the options page - no sidebar by default
$args['help_sidebar'] = __('<p>This is the sidebar content, HTML is allowed.</p>', 'nhp-opts');
$sections = array();
$sections[] = array(
'title' => __('Getting Started', 'nhp-opts'),
'desc' => __('<p class="description">This is the description field for the Section. HTML is allowed</p>', 'nhp-opts'),
//all the glyphicons are included in the options folder, so you can hook into them, or link to your own custom ones.
//You dont have to though, leave it blank for default.
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_062_attach.png'
//Lets leave this as a blank section, no options just some intro text set above.
//'fields' => array()
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_320_facebook.png',
'title' => __('Social Media', 'nhp-opts'),
'desc' => __('<p class="description">Set links to your social media profiles.</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => 'facebook',
'type' => 'text',
'title' => __('Facebook', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'twitter',
'type' => 'text',
'title' => __('Twitter', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'linkedin',
'type' => 'text',
'title' => __('Linkedin', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'googleplus',
'type' => 'text',
'title' => __('Google+', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'youtube',
'type' => 'text',
'title' => __('Youtube', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'pinterest',
'type' => 'text',
'title' => __('Pinterest', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'behance',
'type' => 'text',
'title' => __('Behance', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
)/*,
array(
'id' => 'break_social_1',
'type' => 'info',
'desc' => __('<p class="description">Other profiles</p>', 'nhp-opts')
),
array(
'id' => 'aboutme',
'type' => 'text',
'title' => __('About me', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'instagram',
'type' => 'text',
'title' => __('Instagram', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'bitbucket',
'type' => 'text',
'title' => __('Bitbucket', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'blogger',
'type' => 'text',
'title' => __('Blogger', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'deviantart',
'type' => 'text',
'title' => __('Deviant art', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'digg',
'type' => 'text',
'title' => __('Digg', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'flickr',
'type' => 'text',
'title' => __('Flickr', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'foursquare',
'type' => 'text',
'title' => __('Foursquare', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'github',
'type' => 'text',
'title' => __('Github', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'goodreads',
'type' => 'text',
'title' => __('Goodreads', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'hackernews',
'type' => 'text',
'title' => __('Hacker news', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'kickstarter',
'type' => 'text',
'title' => __('Kickstarter', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'klout',
'type' => 'text',
'title' => __('Klout', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'myspace',
'type' => 'text',
'title' => __('Myspace', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'quora',
'type' => 'text',
'title' => __('Quora', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'skype',
'type' => 'text',
'title' => __('Skype', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'slideshare',
'type' => 'text',
'title' => __('Slideshare', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'soundcloud',
'type' => 'text',
'title' => __('Sound cloud', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'tumblr',
'type' => 'text',
'title' => __('Tumblr', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'vimeo',
'type' => 'text',
'title' => __('Vimeo', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'wikipedia',
'type' => 'text',
'title' => __('Wikipedia', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
),
array(
'id' => 'wordpress',
'type' => 'text',
'title' => __('Wordpress', 'nhp-opts'),
'sub_desc' => __('', 'nhp-opts'),
'desc' => __('', 'nhp-opts'),
'validate' => 'url',
'std' => ''
)*/
)
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_026_road.png',
'title' => __('Map Settings', 'nhp-opts'),
'desc' => __('<p class="description">To find your latitude and longitude navigate to your address using <a href="http://maps.google.com" target="_blank">Google Maps</a> and right click at the location you need the latitude and longitude for. Select <strong>What´s here?</strong> from the menu and copy the numeric vanues that appear in the search field.</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => 'contact_map_lat',
'type' => 'text',
'title' => __('Latitude', 'nhp-opts'),
'sub_desc' => __('The first value.', 'nhp-opts'),
//'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'numeric',
'std' => '0'
),
array(
'id' => 'contact_map_lng',
'type' => 'text',
'title' => __('Longitude', 'nhp-opts'),
'sub_desc' => __('The second value.', 'nhp-opts'),
//'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'numeric',
'std' => '0'
),
array(
'id' => 'contact_map_zoom',
'type' => 'text',
'title' => __('Map Zoom', 'nhp-opts'),
'sub_desc' => __('Zoom level on page load?.', 'nhp-opts'),
'desc' => __('enter a number between 1 and 20.', 'nhp-opts'),
'validate' => 'numeric',
'std' => '14',
'class' => 'small-text'
),
array(
'id' => 'contact_map_pin_title',
'type' => 'text',
'title' => __('Pin Title', 'nhp-opts'),
'sub_desc' => __('If left blank thw site title will be used', 'nhp-opts')
),
array(
'id' => 'contact_map_pin_info',
'type' => 'textarea',
'title' => __('Pin Information', 'nhp-opts'),
'sub_desc' => __('HTML for info box', 'nhp-opts'),
'desc' => __('Add the info you want people to see if they click on the pin', 'nhp-opts'),
'validate' => 'html' //see http://codex.wordpress.org/Function_Reference/wp_kses_post
),
array(
'id' => 'contact_map_directions',
'type' => 'text',
'title' => __('Link for Directions', 'nhp-opts'),
'sub_desc' => __('This must be a URL.', 'nhp-opts'),
'desc' => __('Go to maps.google.com and search for your address. Select the link icon to the left and copy the url.', 'nhp-opts'),
'validate' => 'url',
'std' => 'http://maps.google.com'
),
)
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_023_cogwheels.png',
'title' => __('SEO Settings', 'nhp-opts'),
'desc' => __('<p class="description">Use these options to set descriptions and keyword for search engin indexing</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => 'seo_keywords',
'type' => 'textarea',
'title' => __('Keywords', 'nhp-opts'),
'sub_desc' => __('Add comma seperated keywords.', 'nhp-opts'),
//'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'no_html'
),
array(
'id' => 'seo_description',
'type' => 'textarea',
'title' => __('Description', 'nhp-opts'),
'sub_desc' => __('Add a site descriptions.', 'nhp-opts'),
//'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'no_html'
),
)
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_280_settings.png',
'title' => __('Open Graph', 'nhp-opts'),
'desc' => __('<p class="description">Use these options to set info for social sharing</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => 'og_image',
'type' => 'upload',
'title' => __('Open Graph Image', 'nhp-opts'),
'sub_desc' => __('The image you wish to display across networks', 'nhp-opts')
),
array(
'id' => 'company_facebook_id',
'type' => 'text',
'title' => __('Company Facebook Id', 'nhp-opts'),
'sub_desc' => __('http://findmyfacebookid.com/', 'nhp-opts')
),
array(
'id' => 'location_street_address',
'type' => 'text',
'title' => __('Street Address', 'nhp-opts'),
'sub_desc' => __('Full address', 'nhp-opts')
),
array(
'id' => 'location_city',
'type' => 'text',
'title' => __('City', 'nhp-opts'),
'sub_desc' => __('The city', 'nhp-opts')
),
array(
'id' => 'location_country',
'type' => 'text',
'title' => __('Country', 'nhp-opts'),
'sub_desc' => __('the country', 'nhp-opts')
),
array(
'id' => 'location_region',
'type' => 'text',
'title' => __('Region', 'nhp-opts'),
'sub_desc' => __('the region', 'nhp-opts')
),
array(
'id' => 'location_postal_code',
'type' => 'text',
'title' => __('Postal Code', 'nhp-opts'),
'sub_desc' => __('the postal code', 'nhp-opts')
),
array(
'id' => 'company_email',
'type' => 'text',
'title' => __('Email Address', 'nhp-opts'),
'sub_desc' => __('the email', 'nhp-opts')
),
array(
'id' => 'company_phone_number',
'type' => 'text',
'title' => __('Phone Number', 'nhp-opts'),
'sub_desc' => __('the tel', 'nhp-opts')
),
array(
'id' => 'company_fax_number',
'type' => 'text',
'title' => __('Fax Number', 'nhp-opts'),
'sub_desc' => __('the fax number', 'nhp-opts')
),
array(
'id' => 'company_operating_days',
'type' => 'multi_checkbox',
'title' => __('Operational Days', 'nhp-opts'),
'sub_desc' => __('days youre open', 'nhp-opts'),
//'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array('monday' => 'Monday','tuesday' => 'Tuesday','wednesday' => 'Wednesday','thursday' => 'Thursday','friday' => 'Friday','saturday' => 'Saturday','sunday' => 'Sunday') //Must provide key => value pairs for multi checkbox options
),
array(
'id' => 'company_operating_hours_start',
'type' => 'text',
'title' => __('Opening Time', 'nhp-opts'),
'sub_desc' => __('09:00', 'nhp-opts')
),
array(
'id' => 'company_operating_hours_end',
'type' => 'text',
'title' => __('Closing Time', 'nhp-opts'),
'sub_desc' => __('17:00', 'nhp-opts')
),
)
);
/*
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_107_text_resize.png',
'title' => __('Text Fields', 'nhp-opts'),
'desc' => __('<p class="description">This is the Description. Again HTML is allowed2</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => '1', //must be unique
'type' => 'text', //builtin fields include:
//text|textarea|editor|checkbox|multi_checkbox|radio|radio_img|button_set|select|multi_select|color|date|divide|info|upload
'title' => __('Text Option', 'nhp-opts'),
'sub_desc' => __('This is a little space under the Field Title in the Options table, additonal info is good in here.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
//'validate' => '', //builtin validation includes: email|html|html_custom|no_html|js|numeric|url
//'msg' => 'custom error message', //override the default validation error message for specific fields
//'std' => '', //This is a default value, used to set the options on theme activation, and if the user hits the Reset to defaults Button
//'class' => '' //Set custom classes for elements if you want to do something a little different - default is "regular-text"
),
array(
'id' => '2',
'type' => 'text',
'title' => __('Text Option - Email Validated', 'nhp-opts'),
'sub_desc' => __('This is a little space under the Field Title in the Options table, additonal info is good in here.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'email',
'msg' => 'custom error message',
'std' => 'test@test.com'
),
array(
'id' => 'multi_text',
'type' => 'multi_text',
'title' => __('Multi Text Option', 'nhp-opts'),
'sub_desc' => __('This is a little space under the Field Title in the Options table, additonal info is good in here.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts')
),
array(
'id' => '3',
'type' => 'text',
'title' => __('Text Option - URL Validated', 'nhp-opts'),
'sub_desc' => __('This must be a URL.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'url',
'std' => 'http://no-half-pixels.com'
),
array(
'id' => '4',
'type' => 'text',
'title' => __('Text Option - Numeric Validated', 'nhp-opts'),
'sub_desc' => __('This must be numeric.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'numeric',
'std' => '0',
'class' => 'small-text'
),
array(
'id' => 'comma_numeric',
'type' => 'text',
'title' => __('Text Option - Comma Numeric Validated', 'nhp-opts'),
'sub_desc' => __('This must be a comma seperated string of numerical values.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'comma_numeric',
'std' => '0',
'class' => 'small-text'
),
array(
'id' => 'no_special_chars',
'type' => 'text',
'title' => __('Text Option - No Special Chars Validated', 'nhp-opts'),
'sub_desc' => __('This must be a alpha numeric only.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'no_special_chars',
'std' => '0'
),
array(
'id' => 'str_replace',
'type' => 'text',
'title' => __('Text Option - Str Replace Validated', 'nhp-opts'),
'sub_desc' => __('You decide.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'str_replace',
'str' => array('search' => ' ', 'replacement' => 'thisisaspace'),
'std' => '0'
),
array(
'id' => 'preg_replace',
'type' => 'text',
'title' => __('Text Option - Preg Replace Validated', 'nhp-opts'),
'sub_desc' => __('You decide.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'preg_replace',
'preg' => array('pattern' => '/[^a-zA-Z_ -]/s', 'replacement' => 'no numbers'),
'std' => '0'
),
array(
'id' => 'custom_validate',
'type' => 'text',
'title' => __('Text Option - Custom Callback Validated', 'nhp-opts'),
'sub_desc' => __('You decide.', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate_callback' => 'validate_callback_function',
'std' => '0'
),
array(
'id' => '5',
'type' => 'textarea',
'title' => __('Textarea Option - No HTML Validated', 'nhp-opts'),
'sub_desc' => __('All HTML will be stripped', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'no_html',
'std' => 'No HTML is allowed in here.'
),
array(
'id' => '6',
'type' => 'textarea',
'title' => __('Textarea Option - HTML Validated', 'nhp-opts'),
'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'html', //see http://codex.wordpress.org/Function_Reference/wp_kses_post
'std' => 'HTML is allowed in here.'
),
array(
'id' => '7',
'type' => 'textarea',
'title' => __('Textarea Option - HTML Validated Custom', 'nhp-opts'),
'sub_desc' => __('Custom HTML Allowed (wp_kses)', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'html_custom',
'std' => 'Some HTML is allowed in here.',
'allowed_html' => array('') //see http://codex.wordpress.org/Function_Reference/wp_kses
),
array(
'id' => '8',
'type' => 'textarea',
'title' => __('Textarea Option - JS Validated', 'nhp-opts'),
'sub_desc' => __('JS will be escaped', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'validate' => 'js'
),
array(
'id' => '9',
'type' => 'editor',
'title' => __('Editor Option', 'nhp-opts'),
'sub_desc' => __('Can also use the validation methods if required', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'std' => 'OOOOOOhhhh, rich editing.'
)
,
array(
'id' => 'editor2',
'type' => 'editor',
'title' => __('Editor Option 2', 'nhp-opts'),
'sub_desc' => __('Can also use the validation methods if required', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'std' => 'OOOOOOhhhh, rich editing2.'
)
)
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_150_check.png',
'title' => __('Radio/Checkbox Fields', 'nhp-opts'),
'desc' => __('<p class="description">This is the Description. Again HTML is allowed</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => '10',
'type' => 'checkbox',
'title' => __('Checkbox Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'std' => '1'// 1 = on | 0 = off
),
array(
'id' => '11',
'type' => 'multi_checkbox',
'title' => __('Multi Checkbox Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for multi checkbox options
'std' => array('1' => '1', '2' => '0', '3' => '0')//See how std has changed? you also dont need to specify opts that are 0.
),
array(
'id' => '12',
'type' => 'radio',
'title' => __('Radio Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for radio options
'std' => '2'
),
array(
'id' => '13',
'type' => 'radio_img',
'title' => __('Radio Image Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array(
'1' => array('title' => 'Opt 1', 'img' => 'images/align-none.png'),
'2' => array('title' => 'Opt 2', 'img' => 'images/align-left.png'),
'3' => array('title' => 'Opt 3', 'img' => 'images/align-center.png'),
'4' => array('title' => 'Opt 4', 'img' => 'images/align-right.png')
),//Must provide key => value(array:title|img) pairs for radio options
'std' => '2'
),
array(
'id' => 'radio_img',
'type' => 'radio_img',
'title' => __('Radio Image Option For Layout', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This uses some of the built in images, you can use them for layout options.', 'nhp-opts'),
'options' => array(
'1' => array('title' => '1 Column', 'img' => NHP_OPTIONS_URL.'img/1col.png'),
'2' => array('title' => '2 Column Left', 'img' => NHP_OPTIONS_URL.'img/2cl.png'),
'3' => array('title' => '2 Column Right', 'img' => NHP_OPTIONS_URL.'img/2cr.png')
),//Must provide key => value(array:title|img) pairs for radio options
'std' => '2'
)
)
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_157_show_lines.png',
'title' => __('Select Fields', 'nhp-opts'),
'desc' => __('<p class="description">This is the Description. Again HTML is allowed</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => '14',
'type' => 'select',
'title' => __('Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for select options
'std' => '2'
),
array(
'id' => '15',
'type' => 'multi_select',
'title' => __('Multi Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for radio options
'std' => array('2','3')
)
)
);
$sections[] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_023_cogwheels.png',
'title' => __('Custom Fields', 'nhp-opts'),
'desc' => __('<p class="description">This is the Description. Again HTML is allowed</p>', 'nhp-opts'),
'fields' => array(
array(
'id' => '16',
'type' => 'color',
'title' => __('Color Option', 'nhp-opts'),
'sub_desc' => __('Only color validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'std' => '#FFFFFF'
),
array(
'id' => 'color_gradient',
'type' => 'color_gradient',
'title' => __('Color Gradient Option', 'nhp-opts'),
'sub_desc' => __('Only color validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'std' => array('from' => '#000000', 'to' => '#FFFFFF')
),
array(
'id' => '17',
'type' => 'date',
'title' => __('Date Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts')
),
array(
'id' => '18',
'type' => 'button_set',
'title' => __('Button Set Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts'),
'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'),//Must provide key => value pairs for radio options
'std' => '2'
),
array(
'id' => '19',
'type' => 'upload',
'title' => __('Upload Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This is the description field, again good for additional info.', 'nhp-opts')
),
array(
'id' => 'pages_select',
'type' => 'pages_select',
'title' => __('Pages Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all the sites pages.', 'nhp-opts'),
'args' => array()//uses get_pages
),
array(
'id' => 'pages_multi_select',
'type' => 'pages_multi_select',
'title' => __('Pages Multiple Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a Multi Select menu of all the sites pages.', 'nhp-opts'),
'args' => array('number' => '5')//uses get_pages
),
array(
'id' => 'posts_select',
'type' => 'posts_select',
'title' => __('Posts Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all the sites posts.', 'nhp-opts'),
'args' => array('numberposts' => '10')//uses get_posts
),
array(
'id' => 'posts_multi_select',
'type' => 'posts_multi_select',
'title' => __('Posts Multiple Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a Multi Select menu of all the sites posts.', 'nhp-opts'),
'args' => array('numberposts' => '10')//uses get_posts
),
array(
'id' => 'tags_select',
'type' => 'tags_select',
'title' => __('Tags Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all the sites tags.', 'nhp-opts'),
'args' => array('number' => '10')//uses get_tags
),
array(
'id' => 'tags_multi_select',
'type' => 'tags_multi_select',
'title' => __('Tags Multiple Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a Multi Select menu of all the sites tags.', 'nhp-opts'),
'args' => array('number' => '10')//uses get_tags
),
array(
'id' => 'cats_select',
'type' => 'cats_select',
'title' => __('Cats Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all the sites cats.', 'nhp-opts'),
'args' => array('number' => '10')//uses get_categories
),
array(
'id' => 'cats_multi_select',
'type' => 'cats_multi_select',
'title' => __('Cats Multiple Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a Multi Select menu of all the sites cats.', 'nhp-opts'),
'args' => array('number' => '10')//uses get_categories
),
array(
'id' => 'menu_select',
'type' => 'menu_select',
'title' => __('Menu Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all the sites menus.', 'nhp-opts'),
//'args' => array()//uses wp_get_nav_menus
),
array(
'id' => 'select_hide_below',
'type' => 'select_hide_below',
'title' => __('Select Hide Below Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field requires certain options to be checked before the below field will be shown.', 'nhp-opts'),
'options' => array(
'1' => array('name' => 'Opt 1 field below allowed', 'allow' => 'true'),
'2' => array('name' => 'Opt 2 field below hidden', 'allow' => 'false'),
'3' => array('name' => 'Opt 3 field below allowed', 'allow' => 'true')
),//Must provide key => value(array) pairs for select options
'std' => '2'
),
array(
'id' => 'menu_location_select',
'type' => 'menu_location_select',
'title' => __('Menu Location Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all the themes menu locations.', 'nhp-opts')
),
array(
'id' => 'checkbox_hide_below',
'type' => 'checkbox_hide_below',
'title' => __('Checkbox to hide below', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a checkbox which will allow the user to use the next setting.', 'nhp-opts'),
),
array(
'id' => 'post_type_select',
'type' => 'post_type_select',
'title' => __('Post Type Select Option', 'nhp-opts'),
'sub_desc' => __('No validation can be done on this field type', 'nhp-opts'),
'desc' => __('This field creates a drop down menu of all registered post types.', 'nhp-opts'),
//'args' => array()//uses get_post_types
),
array(
'id' => 'custom_callback',