| 1 |
<?php |
| 2 |
// Subscriber section settings |
| 3 |
$wp_customize->add_section('home_subscriber_section',array( |
| 4 |
'title'=>'Subscriber section settings', |
| 5 |
'description'=>'', |
| 6 |
'panel' => 'section_settings', |
| 7 |
'priority' => 14, |
| 8 |
)); |
| 9 |
|
| 10 |
|
| 11 |
// Subscribe Section Tabs |
| 12 |
$wp_customize->add_setting( |
| 13 |
'innofit_subscribe_tabs', array( |
| 14 |
'sanitize_callback' => 'sanitize_text_field', |
| 15 |
) |
| 16 |
); |
| 17 |
|
| 18 |
$wp_customize->add_control( |
| 19 |
new Innofit_Customize_Control_Tabs( |
| 20 |
$wp_customize, 'innofit_subscribe_tabs', array( |
| 21 |
'section' => 'home_subscriber_section', |
| 22 |
'tabs' => array( |
| 23 |
'general' => array( |
| 24 |
'nicename' => esc_html__( 'General Settings', 'spicebox' ), |
| 25 |
'controls' => array( |
| 26 |
'innofit_subscribe_hide', |
| 27 |
'innofit_subscribe_background', |
| 28 |
'subscribe_image_overlay', |
| 29 |
'subscribe_overlay_section_color', |
| 30 |
'innofit_subscribe_title', |
| 31 |
'innofit_subscribe_subtitle', |
| 32 |
'widgets', |
| 33 |
), |
| 34 |
), |
| 35 |
'sendinblue' => array( |
| 36 |
'nicename' => esc_html__( 'SendinBlue plugin', 'spicebox' ), |
| 37 |
'controls' => array( |
| 38 |
'innofit_subscribe_info', |
| 39 |
), |
| 40 |
), |
| 41 |
), |
| 42 |
) |
| 43 |
) |
| 44 |
); |
| 45 |
|
| 46 |
|
| 47 |
// Subscriber section enable / disable |
| 48 |
$wp_customize->add_setting( 'innofit_subscribe_hide' , array( 'default' => 'on') ); |
| 49 |
$wp_customize->add_control( 'innofit_subscribe_hide' , array( |
| 50 |
'label' => __( 'Enable Suscribe section', 'spicebox' ), |
| 51 |
'section' => 'home_subscriber_section', |
| 52 |
'type' => 'radio', |
| 53 |
'priority' => 1, |
| 54 |
'choices' => array( |
| 55 |
'on'=>__('ON', 'spicebox'), |
| 56 |
'off'=>__('OFF', 'spicebox') |
| 57 |
) |
| 58 |
)); |
| 59 |
|
| 60 |
|
| 61 |
$wp_customize->add_setting( |
| 62 |
'innofit_subscribe_background', array( |
| 63 |
'default' => SPICEB_PLUGIN_URL . 'inc/innofit/images/subscribe/subscribe-bg.jpg', |
| 64 |
'sanitize_callback' => 'esc_url_raw', |
| 65 |
) |
| 66 |
); |
| 67 |
|
| 68 |
$wp_customize->add_control( |
| 69 |
new WP_Customize_Image_Control( |
| 70 |
$wp_customize, 'innofit_subscribe_background', array( |
| 71 |
'label' => esc_html__( 'Background Image', 'spicebox' ), |
| 72 |
'section' => 'home_subscriber_section', |
| 73 |
'priority' => 5, |
| 74 |
) |
| 75 |
) |
| 76 |
); |
| 77 |
|
| 78 |
// Image overlay |
| 79 |
$wp_customize->add_setting( 'subscribe_image_overlay', array( |
| 80 |
'default' => true, |
| 81 |
'sanitize_callback' => '', |
| 82 |
) ); |
| 83 |
|
| 84 |
$wp_customize->add_control('subscribe_image_overlay', array( |
| 85 |
'label' => __('Enable susbcribe image overlay', 'spicebox' ), |
| 86 |
'section' => 'home_subscriber_section', |
| 87 |
'type' => 'checkbox', |
| 88 |
'priority' => 6, |
| 89 |
) ); |
| 90 |
|
| 91 |
|
| 92 |
//Susbcribe Background Overlay Color |
| 93 |
$wp_customize->add_setting( 'subscribe_overlay_section_color', array( |
| 94 |
'sanitize_callback' => 'sanitize_text_field', |
| 95 |
'default' => 'rgba(0, 11, 24, 0.80)', |
| 96 |
) ); |
| 97 |
|
| 98 |
$wp_customize->add_control(new Innofit_Customize_Alpha_Color_Control( $wp_customize,'subscribe_overlay_section_color', array( |
| 99 |
'label' => __('Subscribe image overlay color','spicebox' ), |
| 100 |
'palette' => true, |
| 101 |
'priority' => 7, |
| 102 |
'section' => 'home_subscriber_section') |
| 103 |
) ); |
| 104 |
|
| 105 |
$wp_customize->add_setting( |
| 106 |
'innofit_subscribe_title', array( |
| 107 |
'default' => esc_html__( 'Subscribe to our newsletter', 'spicebox' ), |
| 108 |
'sanitize_callback' => 'sanitize_text_field', |
| 109 |
'transport' => $selective_refresh, |
| 110 |
) |
| 111 |
); |
| 112 |
|
| 113 |
$wp_customize->add_control( |
| 114 |
'innofit_subscribe_title', array( |
| 115 |
'label' => esc_html__( 'Title', 'spicebox' ), |
| 116 |
'section' => 'home_subscriber_section', |
| 117 |
'priority' => 10, |
| 118 |
) |
| 119 |
); |
| 120 |
|
| 121 |
$wp_customize->add_setting( |
| 122 |
'innofit_subscribe_subtitle', array( |
| 123 |
'default' => esc_html__( 'Sign up now for more information about our company.', 'spicebox' ), |
| 124 |
'sanitize_callback' => 'sanitize_text_field', |
| 125 |
'transport' => $selective_refresh, |
| 126 |
) |
| 127 |
); |
| 128 |
|
| 129 |
$wp_customize->add_control( |
| 130 |
'innofit_subscribe_subtitle', array( |
| 131 |
'label' => esc_html__( 'Description', 'spicebox' ), |
| 132 |
'section' => 'home_subscriber_section', |
| 133 |
'priority' => 15, |
| 134 |
) |
| 135 |
); |
| 136 |
if ( class_exists( 'Innofit_Subscribe_Info' ) ) { |
| 137 |
$wp_customize->add_setting( |
| 138 |
'innofit_subscribe_info', array( |
| 139 |
'sanitize_callback' => 'sanitize_text_field', |
| 140 |
) |
| 141 |
); |
| 142 |
|
| 143 |
$wp_customize->add_control( |
| 144 |
new Innofit_Subscribe_Info( |
| 145 |
$wp_customize, 'innofit_subscribe_info', array( |
| 146 |
'label' => esc_html__( 'Instructions', 'spicebox' ), |
| 147 |
'section' => 'home_subscriber_section', |
| 148 |
'capability' => 'install_plugins', |
| 149 |
'priority' => 20, |
| 150 |
) |
| 151 |
) |
| 152 |
); |
| 153 |
} |
| 154 |
|
| 155 |
|
| 156 |
/** |
| 157 |
* Add selective refresh for Front page subscribe section controls. |
| 158 |
*/ |
| 159 |
|
| 160 |
|
| 161 |
$wp_customize->selective_refresh->add_partial( 'innofit_subscribe_title', array( |
| 162 |
'selector' => '.subscribe-newsletter .section-title', |
| 163 |
'settings' => 'innofit_subscribe_title', |
| 164 |
'render_callback' => 'subscribe_title_content_render_callback', |
| 165 |
|
| 166 |
) ); |
| 167 |
|
| 168 |
|
| 169 |
$wp_customize->selective_refresh->add_partial( 'innofit_subscribe_subtitle', array( |
| 170 |
'selector' => '.subscribe-newsletter .section-subtitle', |
| 171 |
'settings' => 'innofit_subscribe_subtitle', |
| 172 |
'render_callback' => 'subscribe_subtitle_content_render_callback', |
| 173 |
|
| 174 |
) ); |
| 175 |
|
| 176 |
|
| 177 |
?> |