| 1 |
<?php |
| 2 |
//Callout Section |
| 3 |
$wp_customize->add_section('home_cta_page_section',array( |
| 4 |
'title' => __('Callout section settings','spicebox'), |
| 5 |
'panel' => 'section_settings', |
| 6 |
'priority' => 15, |
| 7 |
)); |
| 8 |
|
| 9 |
// Enable call to action section |
| 10 |
$wp_customize->add_setting( 'cta_section_enable' , array( 'default' => 'on') ); |
| 11 |
$wp_customize->add_control( 'cta_section_enable' , array( |
| 12 |
'label' => __( 'Enable Home Callout section', 'spicebox' ), |
| 13 |
'section' => 'home_cta_page_section', |
| 14 |
'type' => 'radio', |
| 15 |
'choices' => array( |
| 16 |
'on'=>__('ON', 'spicebox'), |
| 17 |
'off'=>__('OFF', 'spicebox') |
| 18 |
) |
| 19 |
)); |
| 20 |
|
| 21 |
$wp_customize->add_setting( |
| 22 |
'home_call_out_title', |
| 23 |
array( |
| 24 |
'default' => __('We create beautiful WordPress themes for you!','spicebox'), |
| 25 |
'transport' => $selective_refresh, |
| 26 |
) |
| 27 |
); |
| 28 |
$wp_customize->add_control( 'home_call_out_title',array( |
| 29 |
'label' => __('Title','spicebox'), |
| 30 |
'section' => 'home_cta_page_section', |
| 31 |
'type' => 'text',) ); |
| 32 |
|
| 33 |
$wp_customize->add_setting( |
| 34 |
'home_call_out_desc', |
| 35 |
array( |
| 36 |
'default' => __('Choose a package that suits all your needs to build a website.','spicebox'), |
| 37 |
'transport' => $selective_refresh, |
| 38 |
) |
| 39 |
); |
| 40 |
$wp_customize->add_control( 'home_call_out_desc',array( |
| 41 |
'label' => __('Description','spicebox'), |
| 42 |
'section' => 'home_cta_page_section', |
| 43 |
'type' => 'textarea',) ); |
| 44 |
|
| 45 |
|
| 46 |
$wp_customize ->add_setting ( |
| 47 |
'home_call_out_btn_text', |
| 48 |
array( |
| 49 |
'default' => __('Buy Innofit','spicebox'), |
| 50 |
'capability' => 'edit_theme_options', |
| 51 |
'sanitize_callback' => 'sanitize_text_field', |
| 52 |
'transport' => $selective_refresh, |
| 53 |
|
| 54 |
) |
| 55 |
); |
| 56 |
|
| 57 |
$wp_customize->add_control ( |
| 58 |
'home_call_out_btn_text', |
| 59 |
array ( |
| 60 |
'label' => __('Button Text','spicebox'), |
| 61 |
'section' => 'home_cta_page_section', |
| 62 |
'type' => 'text', |
| 63 |
) ); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
$wp_customize->add_setting( 'home_call_out_btn_link',array( |
| 68 |
'default' => __('#','spicebox'), |
| 69 |
'sanitize_callback' => 'spiceb_innofit_home_page_sanitize_text', |
| 70 |
'transport' => $selective_refresh, |
| 71 |
)); |
| 72 |
|
| 73 |
$wp_customize->add_control( 'home_call_out_btn_link',array( |
| 74 |
'label' => __('Button Link','spicebox'), |
| 75 |
'section' => 'home_cta_page_section', |
| 76 |
'type' => 'text', |
| 77 |
)); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
$wp_customize->add_setting( |
| 82 |
'home_call_out_btn_link_target', |
| 83 |
array('sanitize_callback' => 'sanitize_text_field', |
| 84 |
)); |
| 85 |
|
| 86 |
$wp_customize->add_control( |
| 87 |
'home_call_out_btn_link_target', |
| 88 |
array( |
| 89 |
'type' => 'checkbox', |
| 90 |
'label' => __('Open link in new tab','spicebox'), |
| 91 |
'section' => 'home_cta_page_section', |
| 92 |
) |
| 93 |
); |
| 94 |
|
| 95 |
|
| 96 |
/** |
| 97 |
* Add selective refresh for Front page callout section controls. |
| 98 |
*/ |
| 99 |
|
| 100 |
|
| 101 |
$wp_customize->selective_refresh->add_partial( 'home_call_out_title', array( |
| 102 |
'selector' => '.call-to-action-one h4', |
| 103 |
'settings' => 'home_call_out_title', |
| 104 |
'render_callback' => 'home_call_out_title_render_callback', |
| 105 |
|
| 106 |
) ); |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
$wp_customize->selective_refresh->add_partial( 'home_call_out_desc', array( |
| 111 |
'selector' => '.call-to-action-one p', |
| 112 |
'settings' => 'home_call_out_desc', |
| 113 |
'render_callback' => 'home_call_out_desc_render_callback', |
| 114 |
|
| 115 |
) ); |
| 116 |
|
| 117 |
$wp_customize->selective_refresh->add_partial( 'home_call_out_btn_text', array( |
| 118 |
'selector' => '.call-to-action-one .btn-small', |
| 119 |
'settings' => 'home_call_out_btn_text', |
| 120 |
'render_callback' => 'home_call_out_btn_text_render_callback', |
| 121 |
|
| 122 |
) ); |
| 123 |
|
| 124 |
?> |