/var/www/hkosl.com/aga/wp-content/themes/fitness-park/inc/customizer/customizer.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
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
<?php
/**
 * Fitness Park Theme Customizer
 *
 * @package Fitness_Park
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function fitness_park_customize_register($wp_customize)
{
    
$wp_customize->get_setting('blogname')->transport 'postMessage';
    
$wp_customize->get_setting('blogdescription')->transport 'postMessage';
    
$wp_customize->get_setting('header_textcolor')->transport 'postMessage';

    if (isset(
$wp_customize->selective_refresh)) {
        
$wp_customize->selective_refresh->add_partial('blogname', array(
            
'selector' => '.site-title a',
            
'render_callback' => 'fitness_park_customize_partial_blogname',
        ));
        
$wp_customize->selective_refresh->add_partial('blogdescription', array(
            
'selector' => '.site-description',
            
'render_callback' => 'fitness_park_customize_partial_blogdescription',
        ));
    }


    
// List All Pages
    
$slider_pages = array();
    
$slider_pages_obj get_pages();
    
$slider_pages[''] = esc_html__('Select Page''fitness-park');
    foreach (
$slider_pages_obj as $page) {
        
$slider_pages[$page->ID] = $page->post_title;
    }

    
// List All Category
    
$categories get_categories();
    
$blog_cat = array();

    foreach (
$categories as $category) {
        
$blog_cat[$category->term_id] = $category->name;
    }

/**
 * Option to get the frontpage settings to the old default template if a static frontpage is selected
 */
$wp_customize->get_section('static_front_page')->priority 2;

$wp_customize->add_section('fitness_park_enable_frontpage', array(
    
'title' => esc_html__('Enable Front Page''fitness-park'),
    
'priority' => 1
));

    
$wp_customize->add_setting('fitness_park_front_page', array(
        
'sanitize_callback' => 'fitness_park_sanitize_checkbox',
        
'default' => false
    
));

    
$wp_customize->add_control('fitness_park_front_page', array(
        
'type' => 'checkbox',
        
'label' => esc_html__('Enable Fitness Style frontpage?''fitness-park'),
        
'section' => 'fitness_park_enable_frontpage'
    
));


/**
 * Add General Settings Panel
 *
 * @since 1.0.0
*/
$wp_customize->add_panel(
    
'fitness_park_general_settings_panel',
    array(
        
'priority'       => 2,
        
'title'          => esc_html__'General Settings''fitness-park' ),
    )
);

    
$wp_customize->get_section'title_tagline' )->panel 'fitness_park_general_settings_panel';
    
$wp_customize->get_section'title_tagline' )->priority 5;

    
$wp_customize->get_section'colors' )->panel 'fitness_park_general_settings_panel';
    
$wp_customize->get_section('colors' )->title esc_html__('Colors Settings''fitness-park');
    
$wp_customize->get_section'colors' )->priority 6;

    
$wp_customize->get_section'header_image' )->panel 'fitness_park_general_settings_panel';
    
$wp_customize->get_section('header_image' )->title esc_html__('Header Background Image''fitness-park');
    
$wp_customize->get_section'header_image' )->priority 8;

    
$wp_customize->get_section'background_image' )->panel 'fitness_park_general_settings_panel';
    
$wp_customize->get_section'background_image' )->priority 15;

    
$wp_customize->get_section'static_front_page' )->panel 'fitness_park_general_settings_panel';
    
$wp_customize->get_section'static_front_page' )->priority 20;

    
/**
     * Banner Slider
     */
    
$wp_customize->add_section('fitness_park_banner_slider', array(
        
'title' => esc_html__('Banner Slider''fitness-park'),
        
'priority' => 2,
    ));

    
$wp_customize->add_setting('fitness_park_banner_sliders', array(
        
'sanitize_callback' => 'fitness_park_sanitize_repeater',
        
'default' => json_encode(array(
            array(
                
'top_title' => '',
                
'slider_page' => '',
                
'subtitile' => '',
                
'button_text' => '',
                
'button_url' => ''
            
)
        ))
    ));

    
$wp_customize->add_control(new Fitness_Park_Repeater_Controler($wp_customize'fitness_park_banner_sliders', array(
        
'label' => esc_html__('Slider Settings Area''fitness-park'),
        
'section' => 'fitness_park_banner_slider',
        
'settings' => 'fitness_park_banner_sliders',
        
'fp_box_label' => esc_html__('Slider Settings Options''fitness-park'),
        
'fp_box_add_control' => esc_html__('Add New Slider''fitness-park'),
    ),
        array(

            
'slider_page' => array(
                
'type' => 'select',
                
'label' => esc_html__('Select Slider Page''fitness-park'),
                
'options' => $slider_pages
            
),

            
'subtitile' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Subtitle''fitness-park'),
                
'default' => ''
            
),
            
'button_text' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Button Text''fitness-park'),
                
'default' => ''
            
),
            
'button_url' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Button Url''fitness-park'),
                
'default' => ''
            
)
        )));

    
/**
     *  frontpage Setting Panel.
     */
    
$wp_customize->add_panel('fitness_park_homepage', array(
        
'title' => esc_html__('Front Page Setting''fitness-park'),
        
'priority' => 10,
    ));

    
/**
     *  About Us.
     */
    
$wp_customize->add_section('fitness_park_about_us', array(
        
'title' => esc_html__('About Us Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 5
    
));

// About Us image.
    
$wp_customize->add_setting('fitness_park_about_image', array(
        
'sanitize_callback' => 'absint',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize'fitness_park_about_image', array(
        
'label' => esc_html__('Cropped the selected Image''fitness-park'),
        
'section' => 'fitness_park_about_us',
        
'width' => 700,
        
'height' => 700,
    )));

// About Us Page Select.
    
$wp_customize->add_setting('fitness_park_about', array(
        
'sanitize_callback' => 'absint',     //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_about', array(
        
'label' => esc_html__('Select About Us Page''fitness-park'),
        
'settings' => 'fitness_park_about',
        
'section' => 'fitness_park_about_us',
        
'type' => 'dropdown-pages',
    )));

// About Us Subtitle.
    
$wp_customize->add_setting('fitness_park_about_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',     //done    ',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_about_subtitle', array(
        
'label' => esc_html__('Enter Subtitle''fitness-park'),
        
'settings' => 'fitness_park_about_subtitle',
        
'section' => 'fitness_park_about_us',
        
'type' => 'text',
    )));

// About Us Buton.
    
$wp_customize->add_setting('fitness_park_about_button', array(
        
'sanitize_callback' => 'sanitize_text_field',     //done    ',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_about_button', array(
        
'label' => esc_html__('Enter Button Text''fitness-park'),
        
'settings' => 'fitness_park_about_button',
        
'section' => 'fitness_park_about_us',
        
'type' => 'text',
    )));

// About Us Buton URL.
    
$wp_customize->add_setting('fitness_park_about_url', array(
        
'sanitize_callback' => 'esc_url_raw',     //done    ',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_about_url', array(
        
'label' => esc_html__('Enter Button URL''fitness-park'),
        
'settings' => 'fitness_park_about_url',
        
'section' => 'fitness_park_about_us',
        
'type' => 'url',
    )));


    
/**
     *  Call To Action.
     */

    
$wp_customize->add_section('fitness_park_call_to_action', array(
        
'title' => esc_html__('Call To Action Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 5
    
));

    
$wp_customize->add_setting('fitness_park_call_to_action_image', array(
        
'sanitize_callback' => 'absint',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize'fitness_park_call_to_action_image', array(
        
'label' => esc_html__('Cropped the selected Image''fitness-park'),
        
'section' => 'fitness_park_call_to_action',
        
'width' => 1260,
        
'height' => 552,
    )));

// Call To Action Title.
    
$wp_customize->add_setting('fitness_park_call_to_action_title', array(
        
'sanitize_callback' => 'sanitize_text_field',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_call_to_action_title', array(
        
'label' => esc_html__('Enter Section Title''fitness-park'),
        
'settings' => 'fitness_park_call_to_action_title',
        
'section' => 'fitness_park_call_to_action',
        
'type' => 'text',
    )));

// Call To Action Subtitle.
    
$wp_customize->add_setting('fitness_park_call_to_action_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_call_to_action_subtitle', array(
        
'label' => esc_html__('Enter Section Subtitle''fitness-park'),
        
'settings' => 'fitness_park_call_to_action_subtitle',
        
'section' => 'fitness_park_call_to_action',
        
'type' => 'text',
    )));

// Call To Action Button Text.
    
$wp_customize->add_setting('fitness_park_call_to_action_button', array(
        
'sanitize_callback' => 'sanitize_text_field',     //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_call_to_action_button', array(
        
'label' => esc_html__('Enter Button Text''fitness-park'),
        
'settings' => 'fitness_park_call_to_action_button',
        
'section' => 'fitness_park_call_to_action',
        
'type' => 'text',
    )));

// Call To Action Button URl.
    
$wp_customize->add_setting('fitness_park_call_to_action_link', array(
        
'sanitize_callback' => 'esc_url_raw',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_call_to_action_link', array(
        
'label' => esc_html__('Enter Button URL''fitness-park'),
        
'settings' => 'fitness_park_call_to_action_link',
        
'section' => 'fitness_park_call_to_action',
        
'type' => 'url',
    )));

    
/**
     *  Our Service Section.
     */
    
$wp_customize->add_section('fitness_park_service_section', array(
        
'title' => esc_html__('Service Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 10,
    ));

//Service Title.
    
$wp_customize->add_setting('fitness_park_service_title', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_service_title', array(
        
'label' => esc_html__('Enter Section Title''fitness-park'),
        
'settings' => 'fitness_park_service_title',
        
'section' => 'fitness_park_service_section',
        
'type' => 'text',
    )));

//Service Subtitle.
    
$wp_customize->add_setting('fitness_park_service_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_service_subtitle', array(
        
'label' => esc_html__('Enter Section Subtitle''fitness-park'),
        
'settings' => 'fitness_park_service_subtitle',
        
'section' => 'fitness_park_service_section',
        
'type' => 'text',
    )));

    
$wp_customize->add_setting('fitness_park_service', array(
        
'sanitize_callback' => 'fitness_park_sanitize_repeater',
        
'default' => json_encode(array(
            array(
                
'service_page' => '',
                
'service_icon' => 'icon-1.png',
            )
        ))
    ));

    
$wp_customize->add_control(new Fitness_Park_Repeater_Controler($wp_customize'fitness_park_service', array(
        
'label' => esc_html__('Service Page Settings Area''fitness-park'),
        
'section' => 'fitness_park_service_section',
        
'settings' => 'fitness_park_service',
        
'fp_box_label' => esc_html__('Service Page Settings Options''fitness-park'),
        
'fp_box_add_control' => esc_html__('Add New Service Page''fitness-park'),
    ),
        array(

            
'service_page' => array(
                
'type' => 'select',
                
'label' => esc_html__('Select Service Page''fitness-park'),
                
'options' => $slider_pages
            
),
            
'service_icon' => array(
                
'type' => 'icon',
                
'label' => esc_html__('Select Icon''fitness-park'),
                
'default' => 'icon-1.png'
            
),
        )));

    
/**
     *  Appointment.
     */
    
$wp_customize->add_section('fitness_park_appointment', array(
        
'title' => esc_html__('Appointment Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 20,
    ));

//Appointment Image.
    
$wp_customize->add_setting('fitness_park_appointment_image', array(
        
'sanitize_callback' => 'esc_url_raw',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize'fitness_park_appointment_image', array(
        
'label' => esc_html__('Cropped the selected Image''fitness-park'),
        
'setting' => 'fitness_park_appointment_image',
        
'section' => 'fitness_park_appointment',
        
'type' => 'image',
    )));

//Appointment Title.
    
$wp_customize->add_setting('fitness_park_appointment_title', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_appointment_title', array(
        
'label' => esc_html__('Enter Section Title''fitness-park'),
        
'settings' => 'fitness_park_appointment_title',
        
'section' => 'fitness_park_appointment',
        
'type' => 'text',
    )));

//Appointment Subtitle.
    
$wp_customize->add_setting('fitness_park_appointment_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_appointment_subtitle', array(
        
'label' => esc_html__('Enter Section Subtitle''fitness-park'),
        
'settings' => 'fitness_park_appointment_subtitle',
        
'section' => 'fitness_park_appointment',
        
'type' => 'text',
    )));

//Appointment Shortcode.
    
$wp_customize->add_setting('fitness_park_appointment_shortcode', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_appointment_shortcode', array(
        
'label' => esc_html__('Enter Shortcode''fitness-park'),
        
'settings' => 'fitness_park_appointment_shortcode',
        
'section' => 'fitness_park_appointment',
        
'type' => 'text',
        
'description' => esc_html__('Note: First you can install Contact Form 7 plugins and create your form per as you want and enter generated shortcode exmaple : [contact-form-7 id="111" title="Contact form 1"]''fitness-park'),
    )));

    
/**
     * Blog Posts.
     */
    
$wp_customize->add_section('fitness_park_blog_posts', array(
        
'title' => esc_html__('Blog Posts Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 23,
    ));

// Blog Posts title.
    
$wp_customize->add_setting('fitness_park_blog_title', array(
        
'sanitize_callback' => 'sanitize_text_field',     //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_blog_title', array(
        
'label' => esc_html__('Enter Section Title''fitness-park'),
        
'settings' => 'fitness_park_blog_title',
        
'section' => 'fitness_park_blog_posts',
        
'type' => 'text'
    
)));

// Blog Posts subtitle.
    
$wp_customize->add_setting('fitness_park_blog_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',     //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_blog_subtitle', array(
        
'label' => esc_html__('Enter Section Subtitle''fitness-park'),
        
'settings' => 'fitness_park_blog_subtitle',
        
'section' => 'fitness_park_blog_posts',
        
'type' => 'text'
    
)));

    
$wp_customize->add_setting('fitness_park_blog_categories', array(
        
'sanitize_callback' => 'sanitize_text_field',     //done
    
));

    
$wp_customize->add_control(new fitness_park_multiple_check_control($wp_customize'fitness_park_blog_categories', array(
        
'label' => esc_html__('Select Category''fitness-park'),
        
'settings' => 'fitness_park_blog_categories',
        
'section' => 'fitness_park_blog_posts',
        
'choices' => $blog_cat
    
)));

    
/**
     *  Gallery.
     */
    
$wp_customize->add_section('fitness_park_gallery', array(
        
'title' => esc_html__('Gallery Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 25,
    ));

//Gallery Title.
    
$wp_customize->add_setting('fitness_park_gallery_title', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_gallery_title', array(
        
'label' => esc_html__('Enter Section Title''fitness-park'),
        
'settings' => 'fitness_park_gallery_title',
        
'section' => 'fitness_park_gallery',
        
'type' => 'text',
    )));

//Gallery Subtitle.
    
$wp_customize->add_setting('fitness_park_gallery_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_gallery_subtitle', array(
        
'label' => esc_html__('Enter Section Subtitle''fitness-park'),
        
'settings' => 'fitness_park_gallery_subtitle',
        
'section' => 'fitness_park_gallery',
        
'type' => 'text',
    )));

// Image Gallery.
    
$wp_customize->add_setting('fitness_park_image_gallery', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new Fitness_Park_Gallery_Control($wp_customize'fitness_park_image_gallery', array(
        
'label' => esc_html__('Upload Gallery Images''fitness-park'),
        
'settings' => 'fitness_park_image_gallery',
        
'section' => 'fitness_park_gallery',
    )));

    
/**
     *  Trainers.
     */
    
$wp_customize->add_section('fitness_park_testimonials', array(
        
'title' => esc_html__('Trainers Section''fitness-park'),
        
'panel' => 'fitness_park_homepage',
        
'priority' => 25,
    ));

//Testimonials Title.
    
$wp_customize->add_setting('fitness_park_testimonials_title', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_testimonials_title', array(
        
'label' => esc_html__('Enter Section Title''fitness-park'),
        
'settings' => 'fitness_park_testimonials_title',
        
'section' => 'fitness_park_testimonials',
        
'type' => 'text',
    )));

//Trainers Subtitle.
    
$wp_customize->add_setting('fitness_park_testimonials_subtitle', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_testimonials_subtitle', array(
        
'label' => esc_html__('Enter Section Subtitle''fitness-park'),
        
'settings' => 'fitness_park_testimonials_subtitle',
        
'section' => 'fitness_park_testimonials',
        
'type' => 'text',
    )));

//Trainers Pages.
    
$wp_customize->add_setting('fitness_park_testimonials_page', array(
        
'sanitize_callback' => 'fitness_park_sanitize_repeater',
        
'default' => json_encode(array(
            array(
                
'testimonial_page' => '',
                
'designation' => '',
                
'facebook_url' => '',
                
'twitter_url' => '',
                
'youtube_url' => '',
                
'instagram_url' => '',
            )
        ))
    ));

    
$wp_customize->add_control(new Fitness_Park_Repeater_Controler($wp_customize'fitness_park_testimonials_page', array(
        
'label' => esc_html__('Trainers Settings Area''fitness-park'),
        
'section' => 'fitness_park_testimonials',
        
'settings' => 'fitness_park_testimonials_page',
        
'fp_box_label' => esc_html__('Trainers Settings Options''fitness-park'),
        
'fp_box_add_control' => esc_html__('Add New Trainers''fitness-park'),
    ),
        array(

            
'testimonial_page' => array(
                
'type' => 'select',
                
'label' => esc_html__('Select Trainers Page''fitness-park'),
                
'options' => $slider_pages
            
),
            
'designation' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Designation''fitness-park'),
                
'default' => ''
            
),

            
'facebook_url' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Facebook URL''fitness-park'),
                
'default' => ''
            
),
            
'twitter_url' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Twitter URL''fitness-park'),
                
'default' => ''
            
),
            
'youtube_url' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Youtube Url''fitness-park'),
                
'default' => ''
            
),
            
'instagram_url' => array(
                
'type' => 'text',
                
'label' => esc_html__('Enter Instagram Url''fitness-park'),
                
'default' => ''
            
),
        )));

    
/**
     *  Sidebar.
     */
    
$wp_customize->add_section('fitness_park_sidebar_section', array(
        
'title' => esc_html__('Page Layout Settings''fitness-park'),
        
'priority' => 15,
    ));

// Select Sidebar Options.
    
$wp_customize->add_setting('fitness_park_sidebar_options', array(
        
'default' => 'right',
        
'sanitize_callback' => 'fitness_park_sanitize_select'        //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control ($wp_customize'fitness_park_sidebar_options', array(
        
'label' => esc_html__('Post, Page & Category Siderbar Options''fitness-park'),
        
'section' => 'fitness_park_sidebar_section',
        
'setting' => 'fitness_park_sidebar_options',
        
'type' => 'select',
        
'choices' => array(
            
'no' => esc_html__('Full Width''fitness-park'),
            
'right' => esc_html__('Right Sidebar''fitness-park'),
            
'left' => esc_html__('Left Sidebar''fitness-park'),
        )
    )));

    
/**
     *  Footer Content Panel.
     */
    
$wp_customize->add_panel('fitness_park_footer', array(
        
'title' => esc_html__('Footer Settings''fitness-park'),
        
'priority' => 25,
    ));

    
/**
     *  Footer Logo.
     */
    
$wp_customize->add_section('fitness_park_footer_logo', array(
        
'title' => esc_html__('Footer Logo''fitness-park'),
        
'panel' => 'fitness_park_footer',
    ));


    
$wp_customize->add_setting('fitness_park_footer_logo', array(
        
'sanitize_callback' => 'absint',      //done
    
));

    
$wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize'fitness_park_footer_logo', array(
        
'label' => esc_html__('Upload Logo''fitness-park'),
        
'section' => 'fitness_park_footer_logo',
        
'width' => 214,
        
'height' => 69,
    )));
    
/**
     *  Footer Social Links.
     */
    
$wp_customize->add_section('fitness_park_footer_social', array(
        
'title' => esc_html__('Social Links''fitness-park'),
        
'panel' => 'fitness_park_footer',
    ));

// Enable or Disable Footer Social Icon.
    
$wp_customize->add_setting('fitness_park_enable_icon', array(
        
'default' => 'enable',
        
'sanitize_callback' => 'fitness_park_sanitize_switch',     //done
    
));

    
$wp_customize->add_control(new fitness_park_switch_control($wp_customize'fitness_park_enable_icon', array(
        
'label' => esc_html__('Enable Social Icons''fitness-park'),
        
'settings' => 'fitness_park_enable_icon',
        
'section' => 'fitness_park_footer_social',
        
'switch_label' => array(
            
'enable' => esc_html__('Enable''fitness-park'),
            
'disable' => esc_html__('Disable''fitness-park'),
        ),
    )));

    
$wp_customize->add_setting('fitness_Park_footer_icons', array(
        
'sanitize_callback' => 'fitness_park_sanitize_repeater',        //done
        
'default' => json_encode(array(
                array(
                    
'icons' => 'fab fa-facebook',
                    
'icon_url' => '',
                )
            )
        )));

    
$wp_customize->add_control(new Fitness_Park_Repeater_Controler ($wp_customize'fitness_Park_footer_icons',
        array(
            
'label' => esc_html__('Social Icons Setting''fitness-park'),
            
'section' => 'fitness_park_footer_social',
            
'setting' => 'fitness_Park_footer_icons',
            
'fp_box_label' => esc_html__('Social Icons Options''fitness-park'),
            
'fp_box_add_control' => esc_html__('Add New ''fitness-park'),
        ),
        array(
            
'icons' => array(
                
'type' => 'icons',
                
'default' => 'fab fa-facebook',
                
'label' => esc_html__('Select Icon''fitness-park'),
            ),

            
'icon_url' => array(
                
'type' => 'url',
                
'label' => esc_html__('Social Icon Link''fitness-park'),
            ),
        )));


    
/**
     *  Footer Content section.
     */
    
$wp_customize->add_section('fitness_park_copyright', array(
        
'title' => esc_html__('Footer Copyright''fitness-park'),
        
'panel' => 'fitness_park_footer',
    ));

    
//Footer Content.
    
$wp_customize->add_setting('fitness_park_footer_copyright', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_footer_copyright', array(
        
'label' => esc_html__('Enter Footer Content''fitness-park'),
        
'settings' => 'fitness_park_footer_copyright',
        
'section' => 'fitness_park_copyright',
        
'type' => 'text',
    )));

    
/**
     *  Footer Button Section.
     */
    
$wp_customize->add_section('fitness_park_footer_button', array(
        
'title' => esc_html__('Footer Join Button''fitness-park'),
        
'panel' => 'fitness_park_footer',
    ));

    
//Footer Button Text.
    
$wp_customize->add_setting('fitness_park_footer_button_text', array(
        
'sanitize_callback' => 'sanitize_text_field',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_footer_button_text', array(
        
'label' => esc_html__('Enter Button Text''fitness-park'),
        
'settings' => 'fitness_park_footer_button_text',
        
'section' => 'fitness_park_footer_button',
        
'type' => 'text',
    )));

    
//Footer Button URL.
    
$wp_customize->add_setting('fitness_park_footer_button_url', array(
        
'sanitize_callback' => 'esc_url_raw',         //done
    
));

    
$wp_customize->add_control(new WP_Customize_Control($wp_customize'fitness_park_footer_button_url', array(
        
'label' => esc_html__('Enter Button URL''fitness-park'),
        
'settings' => 'fitness_park_footer_button_url',
        
'section' => 'fitness_park_footer_button',
        
'type' => 'url',
    )));

}

add_action('customize_register''fitness_park_customize_register');

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function fitness_park_customize_partial_blogname()
{
    
bloginfo('name');
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function fitness_park_customize_partial_blogdescription()
{
    
bloginfo('description');
}

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 *
 * Enqueue required scripts/styles for customizer panel
 *
 * @since 1.0.0
 *
 */
function fitness_park_customize_scripts()
{

    
wp_enqueue_style('font-awesome'get_template_directory_uri() . '/assets/library/font-awesome/css/fontawsome.css', array(), '5.5.0');

    
wp_enqueue_style('fitness-park-style'get_template_directory_uri() . '/assets/css/customizer.css');

    
wp_enqueue_script('fitness-park-customizer'get_template_directory_uri() . '/assets/js/fitness-park.js', array('jquery''customize-controls'), '20180910'true);

    
// Localize the script with new data
    
$translation_array = array(
        
'url_to_icon' => esc_url(get_template_directory_uri()) . '/assets/images/',
    );
    
wp_localize_script('fitness-park-customizer''fitness_park_script'$translation_array);

}

add_action('customize_controls_enqueue_scripts''fitness_park_customize_scripts');

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function fitness_park_customize_preview_js()
{
    
wp_enqueue_script('fitness-park-customizer'get_template_directory_uri() . '/assets/js/customizer.js', array('customize-preview'), '20151215'true);
}

add_action('customize_preview_init''fitness_park_customize_preview_js');