PluginProbe
SpiceBox / 0.3.5
SpiceBox v0.3.5
trunk 0.2.2 0.2.3 0.2.4 0.2.5 0.2.6 0.2.7 0.2.8 0.2.9 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 0.3.8 0.3.9.1 0.3.9.2 0.4 0.5 0.6 0.7 1.0 All 76 releases
spicebox / inc / innofit / customizer / services-section.php

services-section.php in SpiceBox 0.3.5, at inc/innofit/customizer/services-section.php

97 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /* Services section */
3 $wp_customize->add_section( 'services_section' , array(
4 'title' => __('Services settings', 'spicebox'),
5 'panel' => 'section_settings',
6 'priority' => 2,
7 ) );
8
9
10 // Enable service more btn
11 $wp_customize->add_setting( 'home_service_section_enabled' , array( 'default' => 'on') );
12 $wp_customize->add_control( 'home_service_section_enabled' , array(
13 'label' => __( 'Enable Services on homepage', 'spicebox' ),
14 'section' => 'services_section',
15 'type' => 'radio',
16 'choices' => array(
17 'on'=>__('ON', 'spicebox'),
18 'off'=>__('OFF', 'spicebox')
19 )
20 ));
21
22
23 // Service section title
24 $wp_customize->add_setting( 'home_service_section_title',array(
25 'capability' => 'edit_theme_options',
26 'default' => __('What we do','spicebox'),
27 'sanitize_callback' => 'innofit_home_page_sanitize_text',
28 'transport' => $selective_refresh,
29 ));
30 $wp_customize->add_control( 'home_service_section_title',array(
31 'label' => __('Title','spicebox'),
32 'section' => 'services_section',
33 'type' => 'text',
34 ));
35
36 //Service section discription
37 $wp_customize->add_setting( 'home_service_section_discription',array(
38 'capability' => 'edit_theme_options',
39 'default' => __('Services we provide','spicebox'),
40 'sanitize_callback' => 'innofit_home_page_sanitize_text',
41 'transport' => $selective_refresh,
42 ));
43
44
45 $wp_customize->add_control( 'home_service_section_discription',array(
46 'label' => __('Description','spicebox'),
47 'section' => 'services_section',
48 'type' => 'textarea',
49 ));
50
51 if ( class_exists( 'Innofit_Repeater' ) ) {
52 $wp_customize->add_setting( 'innofit_service_content', array(
53 ) );
54
55 $wp_customize->add_control( new Innofit_Repeater( $wp_customize, 'innofit_service_content', array(
56 'label' => esc_html__( 'Services content', 'spicebox' ),
57 'section' => 'services_section',
58 'priority' => 10,
59 'add_field_label' => esc_html__( 'Add new Service', 'spicebox' ),
60 'item_name' => esc_html__( 'Service', 'spicebox' ),
61 'customizer_repeater_icon_control' => true,
62 'customizer_repeater_title_control' => true,
63 'customizer_repeater_text_control' => true,
64 'customizer_repeater_link_control' => true,
65 'customizer_repeater_checkbox_control' => true,
66 'customizer_repeater_image_control' => true,
67 ) ) );
68 }
69
70
71 /**
72 * Add selective refresh for Front page service section controls.
73 */
74
75
76 $wp_customize->selective_refresh->add_partial( 'home_service_section_title', array(
77 'selector' => '.services .section-header .section-title',
78 'settings' => 'home_service_section_title',
79 'render_callback' => 'innofit_home_service_section_title_render_callback',
80
81 ) );
82
83 $wp_customize->selective_refresh->add_partial( 'home_service_section_discription', array(
84 'selector' => '.services .section-header .section-subtitle',
85 'settings' => 'home_service_section_discription',
86 'render_callback' => 'innofit_home_service_section_discription_render_callback',
87
88 ) );
89
90 $wp_customize->selective_refresh->add_partial( 'innofit_service_content', array(
91 'selector' => '.services #service_content',
92 'settings' => 'innofit_service_content',
93 ) );
94
95
96
97 ?>