| 1 |
<?php |
| 2 |
$wp_customize->add_section('innofit_shop_section',array( |
| 3 |
'title' => __('Home Shop settings','spicebox'), |
| 4 |
'panel' => 'section_settings', |
| 5 |
'priority' => 5, |
| 6 |
)); |
| 7 |
|
| 8 |
$wp_customize->add_setting( 'shop_section_enable' , array( 'default' => 'on') ); |
| 9 |
$wp_customize->add_control( 'shop_section_enable' , array( |
| 10 |
'label' => __( 'Enable Home Shop section', 'spicebox' ), |
| 11 |
'section' => 'innofit_shop_section', |
| 12 |
'type' => 'radio', |
| 13 |
'choices' => array( |
| 14 |
'on'=>__('ON', 'spicebox'), |
| 15 |
'off'=>__('OFF', 'spicebox') |
| 16 |
) |
| 17 |
)); |
| 18 |
|
| 19 |
// Shop section title |
| 20 |
$wp_customize->add_setting( 'home_shop_section_title',array( |
| 21 |
'default' => __('Featured Products','spicebox'), |
| 22 |
'sanitize_callback' => 'innofit_home_page_sanitize_text', |
| 23 |
'transport' => $selective_refresh, |
| 24 |
)); |
| 25 |
$wp_customize->add_control( 'home_shop_section_title',array( |
| 26 |
'label' => __('Title','spicebox'), |
| 27 |
'section' => 'innofit_shop_section', |
| 28 |
'type' => 'text', |
| 29 |
)); |
| 30 |
|
| 31 |
//Shop section discription |
| 32 |
$wp_customize->add_setting( 'home_shop_section_discription',array( |
| 33 |
'default'=> __('Our amazing products','spicebox'), |
| 34 |
'transport' => $selective_refresh, |
| 35 |
)); |
| 36 |
$wp_customize->add_control( 'home_shop_section_discription',array( |
| 37 |
'label' => __('Description','spicebox'), |
| 38 |
'section' => 'innofit_shop_section', |
| 39 |
'type' => 'textarea', |
| 40 |
)); |
| 41 |
|
| 42 |
|
| 43 |
/** |
| 44 |
* Add selective refresh for Front page shop section controls. |
| 45 |
*/ |
| 46 |
|
| 47 |
|
| 48 |
$wp_customize->selective_refresh->add_partial( 'home_shop_section_title', array( |
| 49 |
'selector' => '.shop .section-subtitle', |
| 50 |
'settings' => 'home_shop_section_title', |
| 51 |
'render_callback' => 'home_shop_section_title_render_callback', |
| 52 |
|
| 53 |
) ); |
| 54 |
|
| 55 |
$wp_customize->selective_refresh->add_partial( 'home_shop_section_discription', array( |
| 56 |
'selector' => '.shop .section-title', |
| 57 |
'settings' => 'home_shop_section_discription', |
| 58 |
'render_callback' => 'home_shop_section_discription_render_callback', |
| 59 |
|
| 60 |
) ); |
| 61 |
|
| 62 |
?> |