add_panel( 'panel_about', array(
'priority' => 1,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Global', 'becommerce-store' ),
'description' => __( 'Global Setting for BeCommerceStore.', 'becommerce-store'
),
) );
/*------------------------------------------------------------------------- Contact Section */
$wp_customize->add_setting( 'contact_about',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('contact_about'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
)
);
$wp_customize->add_control( 'contact_about',
array(
'label' => __( 'About', 'becommerce-store' ),
'type' => 'textarea',
'input_attrs' => array(
'class' => 'my-custom-class',
'style' => 'border: 1px solid #999',
'placeholder' => __( 'Enter your information...', 'becommerce-store' ),
),
'section' => 'contact_section',
)
);
// Add our Text field setting and Control for displaying the phone number
$wp_customize->add_section( 'contact_section',
array(
'title' => __( 'Contact', 'becommerce-store' ),
'description' => esc_html__( 'Add your information, address and phone number to the site footer.', 'becommerce-store' ),
'panel' => 'panel_about'
)
);
$wp_customize->add_setting( 'contact_address',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('contact_address'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
)
);
$wp_customize->add_control( 'contact_address',
array(
'label' => __( 'Display address', 'becommerce-store' ),
'type' => 'text',
'section' => 'contact_section'
)
);
$wp_customize->selective_refresh->add_partial( 'contact_address',
array(
'selector' => '.widget-logo',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_contact_address();
},
'fallback_refresh' => true
)
);
$wp_customize->add_setting( 'contact_phone',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('contact_phone'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
)
);
$wp_customize->add_control( 'contact_phone',
array(
'label' => __( 'Display phone number', 'becommerce-store' ),
'type' => 'tel',
'section' => 'contact_section'
)
);
$wp_customize->selective_refresh->add_partial( 'contact_phone',
array(
'selector' => '.widget-logo',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_contact_address();
},
'fallback_refresh' => true
)
);
$wp_customize->add_setting( 'contact_email',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('contact_email'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
)
);
$wp_customize->add_control( 'contact_email',
array(
'label' => __( 'Display email', 'becommerce-store' ),
'type' => 'text',
'section' => 'contact_section'
)
);
$wp_customize->selective_refresh->add_partial( 'contact_email',
array(
'selector' => '.widget-logo',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_contact_address();
},
'fallback_refresh' => true
)
);
$wp_customize->add_setting( 'contact_site',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('contact_site'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
)
);
$wp_customize->add_control( 'contact_site',
array(
'label' => __( 'Display Website', 'becommerce-store' ),
'type' => 'text',
'section' => 'contact_section'
)
);
$wp_customize->selective_refresh->add_partial( 'contact_site',
array(
'selector' => '.widget-logo',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_contact_address();
},
'fallback_refresh' => true
)
);
/*-------------------------------------------------------------------------BeCommerceStore Social Icons Section */
$wp_customize->add_section( 'social_icons_section',
array(
'title' => __( 'Social Icons', 'becommerce-store' ),
'description' => esc_html__( 'Add your social media links and we\'ll automatically match them with the appropriate icons. Drag and drop the URLs to rearrange their order.', 'becommerce-store' ),
'panel' => 'panel_about'
)
);
// Add our Checkbox switch setting and control for opening URLs in a new tab
$wp_customize->add_setting( 'social_newtab',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('social_newtab'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'social_newtab',
array(
'label' => __( 'Open in new browser tab', 'becommerce-store' ),
'section' => 'social_icons_section'
)
) );
$wp_customize->selective_refresh->add_partial( 'social_newtab',
array(
'selector' => '.socials',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_social_media();
},
'fallback_refresh' => true
)
);
// Add our Sortable Repeater setting and Custom Control for Social media URLs
$wp_customize->add_setting( 'social_urls',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'skyrocket_url_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Sortable_Repeater_Custom_Control( $wp_customize, 'social_urls',
array(
'label' => __( 'Social URLs', 'becommerce-store' ),
'description' => esc_html__( 'Add your social media links.', 'becommerce-store' ),
'section' => 'social_icons_section',
'button_labels' => array(
'add' => __( 'Add Icon', 'becommerce-store' ),
)
)
) );
$wp_customize->selective_refresh->add_partial( 'social_urls',
array(
'selector' => '.socials',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_social_media();
},
'fallback_refresh' => true
)
);
// Add our Single Accordion setting and Custom Control to list the available Social Media icons
$becommerce_store_socialIconsList = array(
'Behance' => __( '', 'becommerce-store' ),
'Discord' => __( '', 'becommerce-store' ),
'Dribbble' => __( '', 'becommerce-store' ),
'Facebook' => __( '', 'becommerce-store' ),
'GitHub' => __( '', 'becommerce-store' ),
'Instagram' => __( '', 'becommerce-store' ),
'LinkedIn' => __( '', 'becommerce-store' ),
'Mastadon' => __( '', 'becommerce-store' ),
'Medium' => __( '', 'becommerce-store' ),
'Pinterest' => __( '', 'becommerce-store' ),
'Quora' => __( '', 'becommerce-store' ),
'Reddit' => __( '', 'becommerce-store' ),
'Slack' => __( '', 'becommerce-store' ),
'Snapchat' => __( '', 'becommerce-store' ),
'Spotify' => __( '', 'becommerce-store' ),
'Stack Overflow' => __( '', 'becommerce-store' ),
'Steam' => __( '', 'becommerce-store' ),
'Telegram' => __( '', 'becommerce-store' ),
'TikTok' => __( '', 'becommerce-store' ),
'Twitch' => __( '', 'becommerce-store' ),
'Twitter' => __( '', 'becommerce-store' ),
'Unity' => __( '', 'becommerce-store' ),
'Vimeo' => __( '', 'becommerce-store' ),
'Weibo' => __( '', 'becommerce-store' ),
'WhatsApp' => __( '', 'becommerce-store' ),
'YouTube' => __( '', 'becommerce-store' ),
);
$wp_customize->add_setting( 'social_url_icons',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_text_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Single_Accordion_Custom_Control( $wp_customize, 'social_url_icons',
array(
'label' => __( 'View list of available icons', 'becommerce-store' ),
'description' => $becommerce_store_socialIconsList,
'section' => 'social_icons_section'
)
) );
################################ End BeCommerceStore Global Options ################################################
/**
* Add our Upsell Section
*/
$wp_customize->add_section( new Skyrocket_Upsell_Section( $wp_customize, 'upsell_section',
array(
'title' => __( 'Becommerce Store Documentation', 'becommerce-store' ),
'url' => 'https://www.couponvario.com/themewp/becommerce-store',
'backgroundcolor' => '#344860',
'textcolor' => '#fff',
'priority' => 0,
)
) );
################################ BeCommerceStore Top Header Options ####################################################
$wp_customize->add_panel('header_theme_option',
array(
'title' => 'BeCommerce Store Header Options',
'capability' => 'edit_theme_options',
'priority' => 2
)
);
$wp_customize->add_section(
'title_tagline',
array(
'priority' => 1,
'title' => __('Site Identity','becommerce-store'),
'panel' => 'header_theme_option',
)
);
/* ================================================================= Top Header Section */
$wp_customize->add_section(
'sec_top_header', array(
'title' => __( 'Top Header Setting', 'becommerce-store'),
'panel' => 'header_theme_option'
)
);
/*------------------------------------------------------------------ Top Header Section */
// Add our Checkbox switch setting and control for show newsflash
$wp_customize->add_setting( 'top_header_social_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('top_header_social_show'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'top_header_social_show',
array(
'label' => __( 'Show Socials Media', 'becommerce-store' ),
'section' => 'sec_top_header'
)
) );
$wp_customize->selective_refresh->add_partial( 'social_urls',
array(
'selector' => '.socials',
'container_inclusive' => false,
'render_callback' => function() {
echo becommerce_store_get_social_media();
},
'fallback_refresh' => true
)
);
// redirect sidebar toggle button link
$wp_customize->add_setting( 'header_top_social_toggle_button_redirects', array(
'sanitize_callback' => 'skyrocket_switch_sanitization',
));
$wp_customize->add_control(
new BE_WP_Redirect_Control( $wp_customize, 'header_top_social_toggle_button_redirects', array(
'section' => 'sec_top_header',
'settings' => 'header_top_social_toggle_button_redirects',
'choices' => array(
'header-social-icons' => array(
'type' => 'section',
'id' => 'social_icons_section',
'label' => esc_html__( 'Manage your social account from here', 'becommerce-store' )
)
)
))
);
// Divider control
$wp_customize->add_setting( 'divider_control_1',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_1',
array(
'label' => '',
'description' => '',
'section' => 'sec_top_header',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)
));
/*-------------------------------------------------------------------------Offer Top Menu Section */
$wp_customize->add_setting( 'top_header_offer',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('top_header_offer'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
)
);
$wp_customize->add_control( 'top_header_offer',
array(
'label' => __( 'Offer Messeges', 'becommerce-store' ),
'description' => esc_html__( 'If empty, the offer message will not shown.', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_top_header'
)
);
$wp_customize->selective_refresh->add_partial( 'top_header_offer',
array(
'selector' => '.top-offer',
'container_inclusive' => false,
'fallback_refresh' => true
)
);
// Divider control
$wp_customize->add_setting( 'divider_control_2',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_2',
array(
'label' => '',
'description' => '',
'section' => 'sec_top_header',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)
) );
/*-------------------------------------------------------------------------becommerce_store Top Menu Section */
// Add our Checkbox switch setting and control for show newsflash
$wp_customize->add_setting( 'top_header_menu_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('top_header_menu_show'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'top_header_menu_show',
array(
'label' => __( 'Show Top Menu', 'becommerce-store' ),
'section' => 'sec_top_header'
)
) );
$wp_customize->selective_refresh->add_partial( 'top_header_menu',
array(
'selector' => '.track-order',
'container_inclusive' => false,
'fallback_refresh' => true
)
);
// Divider control
$wp_customize->add_setting( 'divider_control_3',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_3',
array(
'label' => '',
'description' => '',
'section' => 'sec_top_header',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)
) );
/* ================================================================= End Top Header Section */
/* ================================================================= Mid Header Section */
$wp_customize->add_section(
'sec_mid_header', array(
'title' => __( 'Mid Header Setting', 'becommerce-store'),
'panel' => 'header_theme_option'
)
);
/*-------------------------------------------------------------------------becommerce_store Logo Section */
// Add upload image logo
// Test of Simple Notice control
$wp_customize->add_setting( 'manage_logo_notice', array(
'transport' => 'postMessage',
'sanitize_callback' => 'skyrocket_text_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Simple_Notice_Custom_control( $wp_customize, 'manage_logo_notice', array(
'label' => __( 'Logo Setting', 'becommerce-store' ),
'description' => __( 'Upload your logo or site identity at Title Section. Click button below. ', 'becommerce-store' ),
'section' => 'sec_mid_header'
)
) );
// redirect sidebar toggle button link
$wp_customize->add_setting( 'header_mid_logo_toggle_button_redirects', array(
'sanitize_callback' => 'skyrocket_switch_sanitization',
));
$wp_customize->add_control(
new BE_WP_Redirect_Control( $wp_customize, 'header_mid_logo_toggle_button_redirects', array(
'section' => 'sec_mid_header',
'settings' => 'header_mid_logo_toggle_button_redirects',
'choices' => array(
'header-mid-log' => array(
'type' => 'section',
'id' => 'title_tagline',
'label' => esc_html__( 'Manage Logo or Site Identity from here', 'becommerce-store' )
)
)
))
);
// Add upload image logo
// Test of Simple Notice control
$wp_customize->add_setting( 'manage_menu_mid_notice', array(
'transport' => 'postMessage',
'sanitize_callback' => 'skyrocket_text_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Simple_Notice_Custom_control( $wp_customize, 'manage_menu_mid_notice', array(
'label' => __( 'Main Menu Setting', 'becommerce-store' ),
'description' => __( 'Setting your menu at Nav Menus Section. ', 'becommerce-store' ),
'section' => 'sec_mid_header'
)
) );
// Divider control
$wp_customize->add_setting( 'divider_control_4',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_4',
array(
'label' => '',
'description' => '',
'section' => 'sec_mid_header',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)
) );
/*-------------------------------------------------------------------------becommerce_store CTA Section */
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'becommerce_store_cta_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('becommerce_store_cta_show'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'becommerce_store_cta_show',
array(
'label' => __( 'Show CTA Right', 'becommerce-store' ),
'section' => 'sec_mid_header'
)
) );
// Field 2 - CTA Filter
$wp_customize->add_setting( 'cta_filter_data',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_filter_data'),
'sanitize_callback' => 'skyrocket_radio_sanitization'
)
);
$wp_customize->add_control( 'cta_filter_data',
array(
'label' => __( 'CTA Types', 'becommerce-store' ),
'section' => 'sec_mid_header',
'type' => 'radio',
'choices' => array(
'cta_offer' => __( 'Offer', 'becommerce-store' ),
'cta_phone' => __( 'Phone Number', 'becommerce-store' )
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'becommerce_store_cta_show' )->value() == 1 ) {
return true;
}
return false;
}
)
);
//CTA Offer Text
$wp_customize->add_setting( 'cta_offer_text', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_offer_text'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_offer_text', array(
'label' => __( 'Offer Messeges', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_mid_header',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_filter_data' )->value() == 'cta_offer' && $setting->manager->get_setting( 'becommerce_store_cta_show' )->value() == 1 ) {
return true;
}
return false;
}
));
//CTA Offer URL
$wp_customize->add_setting( 'cta_offer_url', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_offer_url'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_offer_url', array(
'label' => __( 'Offer URL', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_mid_header',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_filter_data' )->value() == 'cta_offer' && $setting->manager->get_setting( 'becommerce_store_cta_show' )->value() == 1 ) {
return true;
}
return false;
}
));
//CTA Phone Number
$wp_customize->add_setting( 'cta_phone_icon', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_phone_icon'),
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control( new becommerce_store_Icon_Picker_Control( $wp_customize, 'cta_phone_icon',
array(
'label' => __( 'Phone Icon', 'becommerce-store' ),
'section' => 'sec_mid_header',
'capability' => 'edit_theme_options',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_filter_data' )->value() == 'cta_phone' && $setting->manager->get_setting( 'becommerce_store_cta_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
$wp_customize->add_setting( 'cta_phone_text',
array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_phone_text'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_phone_text',
array(
'label' => __( 'Hotline Text', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_mid_header',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_filter_data' )->value() == 'cta_phone' && $setting->manager->get_setting( 'becommerce_store_cta_show' )->value() == 1 ) {
return true;
}
return false;
}
));
// redirect sidebar toggle button link
$wp_customize->add_setting( 'header_mid_phone_number_toggle_button_redirects', array(
'sanitize_callback' => 'skyrocket_switch_sanitization',
));
$wp_customize->add_control(
new BE_WP_Redirect_Control( $wp_customize, 'header_mid_phone_number_toggle_button_redirects', array(
'section' => 'sec_mid_header',
'settings' => 'header_mid_phone_number_toggle_button_redirects',
'choices' => array(
'header-phone-number' => array(
'type' => 'section',
'id' => 'contact_section',
'label' => esc_html__( 'Manage your phone number from here', 'becommerce-store' )
)
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_filter_data' )->value() == 'cta_phone' && $setting->manager->get_setting( 'becommerce_store_cta_show' )->value() == 1 ) {
return true;
}
return false;
}
))
);
/* ================================================================= End Mid Header Section */
/* ================================================================= Bottom Header Section */
$wp_customize->add_section(
'sec_bottom_header', array(
'title' => __( 'Bottom Header Setting', 'becommerce-store'),
'panel' => 'header_theme_option'
));
/*-------------------------------------------------------------------------becommerce_store Menu Big Categories Section */
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'menu_cat_big_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('menu_cat_big_show'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'menu_cat_big_show',
array(
'label' => __( 'Show Categories Big Menu', 'becommerce-store' ),
'description' => esc_html__( 'Create and select the categories from Menu Settings. Check our documentation', 'becommerce-store' ),
'section' => 'sec_bottom_header'
)
) );
$wp_customize->add_setting( 'menu_cat_big_text', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('menu_cat_big_text'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'menu_cat_big_text', array(
'label' => __( 'Menu Categories Text', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_bottom_header',
'active_callback' => function( $setting ) {
if ($setting->manager->get_setting( 'menu_cat_big_show' )->value() == 1 ) {
return true;
}
return false;
}
));
// Color Picker Button
$wp_customize->add_setting( 'menu_category_big_text_button_color', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('menu_category_big_text_button_color'),
'sanitize_callback' => 'skyrocket_hex_rgba_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Customize_Alpha_Color_Control( $wp_customize, 'menu_category_big_text_button_color',
array(
'label' => __( 'Text Button Color', 'becommerce-store' ),
'section' => 'sec_bottom_header',
'show_opacity' => true,
'palette' => array(
'#000',
'#fff',
'#e44311',
'#df9a23',
'#eef000',
'#7ed934',
'#1571c1',
'#8309e7'
),
'active_callback' => function( $setting ) {
if ($setting->manager->get_setting( 'menu_cat_big_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
// Color Picker Button
$wp_customize->add_setting( 'menu_category_big_button_color', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('menu_category_big_button_color'),
'sanitize_callback' => 'skyrocket_hex_rgba_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Customize_Alpha_Color_Control( $wp_customize, 'menu_category_big_button_color',
array(
'label' => __( 'Button Color', 'becommerce-store' ),
'section' => 'sec_bottom_header',
'show_opacity' => true,
'palette' => array(
'#000',
'#fff',
'#e44311',
'#df9a23',
'#eef000',
'#7ed934',
'#1571c1',
'#8309e7'
),
'active_callback' => function( $setting ) {
if ($setting->manager->get_setting( 'menu_cat_big_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
// Divider control
$wp_customize->add_setting( 'divider_control_5',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_5',
array(
'label' => '',
'description' => '',
'section' => 'sec_bottom_header',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)
) );
/*-------------------------------------------------------------------------becommerce_store Menu Search Categories Section */
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'menu_cat_search_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => 1,
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'menu_cat_search_show',
array(
'label' => __( 'Show Categories Search Menu ', 'becommerce-store' ),
'description' => esc_html__( 'Create and select the categories from Menu Settings. Check our documentation', 'becommerce-store' ),
'section' => 'sec_bottom_header'
)
) );
// Divider control
$wp_customize->add_setting( 'divider_control_6',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_6',
array(
'label' => '',
'description' => '',
'section' => 'sec_bottom_header',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)
) );
/* ================================================================= End Bottom Header Section */
################################ End becommerce_store Header Options ################################################
################################ becommerce_store Frontpage Options ################################################
$wp_customize->add_panel('frontpage_theme_option',
array(
'title' => 'Becommerce store Homepage Options',
'capability' => 'edit_theme_options',
'priority' => 3
)
);
/*------------------------------------------------------------------ Slider Section */
$wp_customize->add_section( 'sec_slider_frontpage', array(
'title' => __( 'Slider Setting', 'becommerce-store'),
'description' => __( 'Slider Setting Section', 'becommerce-store' ),
'panel' => 'frontpage_theme_option'
)
);
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'slider_frontpage_show', array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('slider_frontpage_show'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'slider_frontpage_show', array(
'label' => __( 'Show Slider', 'becommerce-store' ),
'section' => 'sec_slider_frontpage'
)
) );
$wp_customize->add_setting( 'repeater_slider_frontpage', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('repeater_slider_frontpage'),
'sanitize_callback' => 'customizer_repeater_sanitize'
));
$wp_customize->add_control( new Customizer_Repeater( $wp_customize, 'repeater_slider_frontpage', array(
'label' => esc_html__('Slide','becommerce-store'),
'section' => 'sec_slider_frontpage',
'customizer_repeater_title_control' => true,
'customizer_repeater_subtitle_control' => true,
'customizer_repeater_image_control' => true,
'customizer_repeater_text_control' => true,
'customizer_repeater_link_control' => true,
'customizer_repeater_button_text_control' => true,
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'slider_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) ) );
/*------------------------------------------------------------------ Service Section */
$wp_customize->add_section(
'sec_service_frontpage', array(
'title' => __( 'Service Setting', 'becommerce-store'),
'description' => __( 'Service Setting Section', 'becommerce-store' ),
'panel' => 'frontpage_theme_option'
)
);
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'service_frontpage_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('service_frontpage_show'),
)
);
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'service_frontpage_show',
array(
'label' => __( 'Show Service', 'becommerce-store' ),
'section' => 'sec_service_frontpage'
)
) );
for ( $srvjm = 1; $srvjm < 5; $srvjm++ ) :
$wp_customize->add_setting( 'service_list_title_' . $srvjm, array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('service_list_title_' . $srvjm),
'sanitize_callback' => 'wp_filter_nohtml_kses',
) );
$wp_customize->add_control( 'service_list_title_' . $srvjm , array(
'section' => 'sec_service_frontpage',
'type' => 'text',
'label' => sprintf( __( 'Service Title %d', 'becommerce-store' ), $srvjm),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'service_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) );
$wp_customize->add_setting( 'service_list_subtitle_' . $srvjm, array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('service_list_subtitle_' . $srvjm),
'sanitize_callback' => 'wp_filter_nohtml_kses',
) );
$wp_customize->add_control( 'service_list_subtitle_' . $srvjm , array(
'section' => 'sec_service_frontpage',
'type' => 'text',
'label' => sprintf( __( 'Service Subtitle %d', 'becommerce-store' ), $srvjm),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'service_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) );
$wp_customize->add_setting( 'service_list_icon_' . $srvjm, array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('service_list_icon_' . $srvjm),
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control( new becommerce_store_Icon_Picker_Control( $wp_customize, 'service_list_icon_' . $srvjm,
array(
'label' => sprintf( __( 'Service Icon %d', 'becommerce-store' ), $srvjm),
'section' => 'sec_service_frontpage',
'capability' => 'edit_theme_options',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'service_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
$wp_customize->add_setting( 'divider_service_'. $srvjm, array(
'transport' => 'postMessage',
'sanitize_callback' => 'skyrocket_text_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_service_'. $srvjm, array(
'label' => '',
'description' => '',
'section' => 'sec_service_frontpage',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'service_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
endfor;
/*------------------------------------------------------------------ CTA Section */
$wp_customize->add_section(
'sec_cta_frontpage', array(
'title' => __( 'CTA Setting', 'becommerce-store'),
'description' => __( 'CTA Setting Section', 'becommerce-store' ),
'panel' => 'frontpage_theme_option'
)
);
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'cta_frontpage_show',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => 1,
));
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'cta_frontpage_show', array(
'label' => __( 'Show CTA', 'becommerce-store' ),
'section' => 'sec_cta_frontpage'
)) );
//cta_frontpage_show_column
for ( $sjm = 1; $sjm < 4; $sjm++ ) :
$wp_customize->add_setting( 'cta_title_' . $sjm, array(
'transport' => 'refresh',
'sanitize_callback' => 'wp_filter_nohtml_kses',
'default' => BE\becommerce_store_generate_defaults('cta_title_' . $sjm),
) );
$wp_customize->add_control( 'cta_title_' . $sjm , array(
'section' => 'sec_cta_frontpage',
'type' => 'text',
'label' => sprintf( __( 'CTA Title %d', 'becommerce-store' ), $sjm),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) );
$wp_customize->add_setting( 'cta_subtitle_' . $sjm, array(
'transport' => 'refresh',
'sanitize_callback' => 'wp_filter_nohtml_kses',
'default' => BE\becommerce_store_generate_defaults('cta_subtitle_' . $sjm),
) );
$wp_customize->add_control( 'cta_subtitle_' . $sjm , array(
'section' => 'sec_cta_frontpage',
'type' => 'text',
'label' => sprintf( __( 'CTA Subtitle %d', 'becommerce-store' ), $sjm),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) );
$wp_customize->add_setting( 'cta_button_text_' . $sjm, array(
'transport' => 'refresh',
'sanitize_callback' => 'wp_filter_nohtml_kses',
'default' => BE\becommerce_store_generate_defaults('cta_button_text_' . $sjm),
) );
$wp_customize->add_control( 'cta_button_text_' . $sjm , array(
'section' => 'sec_cta_frontpage',
'type' => 'text',
'label' => sprintf( __( 'CTA Button Text %d', 'becommerce-store' ), $sjm),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) );
$wp_customize->add_setting( 'cta_button_url_' . $sjm, array(
'transport' => 'refresh',
'sanitize_callback' => 'wp_filter_nohtml_kses',
'default' => BE\becommerce_store_generate_defaults('cta_button_url_' . $sjm),
) );
$wp_customize->add_control( 'cta_button_url_' . $sjm , array(
'section' => 'sec_cta_frontpage',
'type' => 'text',
'label' => sprintf( __( 'CTA Button URL %d', 'becommerce-store' ), $sjm),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
) );
// Cropped Image Control
$wp_customize->add_setting( 'cta_cropped_image_' . $sjm, array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_cropped_image_' . $sjm),
'sanitize_callback' => 'absint'
));
$wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'cta_cropped_image_' . $sjm, array(
'label' => sprintf( __( 'CTA Image %d', 'becommerce-store' ), $sjm),
'section' => 'sec_cta_frontpage',
'flex_width' => false,
'flex_height' => false,
'width' => 380,
'height' => 250,
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)) );
$wp_customize->add_setting( 'divider_cta_'. $sjm, array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_cta_'. $sjm, array(
'label' => '',
'description' => '',
'section' => 'sec_cta_frontpage',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'cta_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
endfor;
if( class_exists( 'WooCommerce' ) ) {
/*------------------------------------------------------------------ Best Seller Section */
$wp_customize->add_section(
'sec_bestseller_frontpage', array(
'title' => __( 'Best Seller Setting', 'becommerce-store'),
'description' => __( 'Best Seller Product Section', 'becommerce-store' ),
'panel' => 'frontpage_theme_option'
));
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'bestseller_frontpage_show', array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('bestseller_frontpage_show'),
));
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'bestseller_frontpage_show', array(
'label' => __( 'Show Best Seller Product', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage'
)) );
$wp_customize->add_setting(
'set_best_seller_title', array(
'type' => 'theme_mod',
'default' => BE\becommerce_store_generate_defaults('set_best_seller_title'),
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
'set_best_seller_title', array(
'label' => __( 'Title ', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage',
'type' => 'text'
));
// Show Grid Posts By Categories
$wp_customize->add_setting( 'bestseller_by_categories',
array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_text_sanitization',
'default' => BE\becommerce_store_generate_defaults('bestseller_by_categories'),
));
$wp_customize->add_control( new Be_Dropdown_Select2_Custom_Control( $wp_customize, 'bestseller_by_categories',
array(
'label' => __( 'Choose Categories ', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage',
'input_attrs' => array(
'multiselect' => true,
),
'choices' => becommerce_store_get_categories_product_array(),
)) );
// Divider control
$wp_customize->add_setting( 'divider_control_7',
array(
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control( new Skyrocket_Divider_Custom_Control( $wp_customize, 'divider_control_7',
array(
'label' => '',
'description' => '',
'section' => 'sec_bestseller_frontpage',
'input_attrs' => array(
'width' => 'full',
'type' => 'solid',
'margintop' => 10,
'marginbottom' => 10,
),
)) );
$wp_customize->add_setting( 'banner_bestseller_frontpage_show', array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('banner_bestseller_frontpage_show'),
));
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'banner_bestseller_frontpage_show', array(
'label' => __( 'Show CTA Banner Best Seller', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage'
)) );
//Field Title
$wp_customize->add_setting( 'cta_banner_title_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_title_bestseller'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_banner_title_bestseller', array(
'label' => __( 'CTA Banner Title', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_bestseller_frontpage',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
//Field SubTitle
$wp_customize->add_setting( 'cta_banner_subtitle_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_subtitle_bestseller'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_banner_subtitle_bestseller', array(
'label' => __( 'CTA Banner SubTitle', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_bestseller_frontpage',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
//Field SubTitle
$wp_customize->add_setting( 'cta_banner_text_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_text_bestseller'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_banner_text_bestseller', array(
'label' => __( 'CTA Banner Text', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_bestseller_frontpage',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
// Color Picker Button
$wp_customize->add_setting( 'cta_banner_text_color_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_text_color_bestseller'),
'sanitize_callback' => 'skyrocket_hex_rgba_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Customize_Alpha_Color_Control( $wp_customize, 'cta_banner_text_color_bestseller',
array(
'label' => __( 'Text Color', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage',
'show_opacity' => true,
'palette' => array(
'#000',
'#fff',
'#e44311',
'#df9a23',
'#eef000',
'#7ed934',
'#1571c1',
'#8309e7'
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
$wp_customize->add_setting( 'cta_upload_banner_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_upload_banner_bestseller'),
'sanitize_callback' => 'absint'
));
$wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'cta_upload_banner_bestseller', array(
'label' => esc_html__( 'Image Banner', 'becommerce-store' ),
'description' => esc_html__('Image will be cropped 375x500.', 'becommerce-store'),
'section' => 'sec_bestseller_frontpage',
'flex_width' => false,
'flex_height' => false,
'width' => 375,
'height' => 500,
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)) );
$wp_customize->add_setting( 'cta_banner_url_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_url_bestseller'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_banner_url_bestseller', array(
'label' => __( 'Button URL', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_bestseller_frontpage',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
$wp_customize->add_setting( 'cta_banner_button_label_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_button_label_bestseller'),
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( 'cta_banner_button_label_bestseller', array(
'label' => __( 'Button Label', 'becommerce-store' ),
'type' => 'text',
'section' => 'sec_bestseller_frontpage',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
// Color Picker Button
$wp_customize->add_setting( 'cta_banner_button_text_color_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_button_text_color_bestseller'),
'sanitize_callback' => 'skyrocket_hex_rgba_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Customize_Alpha_Color_Control( $wp_customize, 'cta_banner_button_text_color_bestseller',
array(
'label' => __( 'Button Label Color', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage',
'show_opacity' => true,
'palette' => array(
'#000',
'#fff',
'#e44311',
'#df9a23',
'#eef000',
'#7ed934',
'#1571c1',
'#8309e7'
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
// Color Picker Button
$wp_customize->add_setting( 'cta_banner_button_color_bestseller', array(
'transport' => 'refresh',
'default' => BE\becommerce_store_generate_defaults('cta_banner_button_color_bestseller'),
'sanitize_callback' => 'skyrocket_hex_rgba_sanitization'
)
);
$wp_customize->add_control( new Skyrocket_Customize_Alpha_Color_Control( $wp_customize, 'cta_banner_button_color_bestseller',
array(
'label' => __( 'Button Color', 'becommerce-store' ),
'section' => 'sec_bestseller_frontpage',
'show_opacity' => true,
'palette' => array(
'#000',
'#fff',
'#e44311',
'#df9a23',
'#eef000',
'#7ed934',
'#1571c1',
'#8309e7'
),
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'banner_bestseller_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
)
) );
/*------------------------------------------------------------------ Recent Section */
$wp_customize->add_section(
'sec_recent_frontpage', array(
'title' => __( 'Recent Product Setting', 'becommerce-store'),
'description' => __( 'Recent Product Section', 'becommerce-store' ),
'panel' => 'frontpage_theme_option'
));
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'recent_frontpage_show', array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('recent_frontpage_show'),
));
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'recent_frontpage_show', array(
'label' => __( 'Show Recent Product', 'becommerce-store' ),
'section' => 'sec_recent_frontpage'
)) );
$wp_customize->add_setting(
'set_recent_frontpage_title', array(
'type' => 'theme_mod',
'default' => BE\becommerce_store_generate_defaults('set_recent_frontpage_title'),
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
'set_recent_frontpage_title', array(
'label' => __( 'Title ', 'becommerce-store' ),
'section' => 'sec_recent_frontpage',
'type' => 'text',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'recent_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
$wp_customize->add_setting(
'set_recent_frontpage_url', array(
'type' => 'theme_mod',
'default' => BE\becommerce_store_generate_defaults('set_recent_frontpage_url'),
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
'set_recent_frontpage_url', array(
'label' => __( 'Set URL ', 'becommerce-store' ),
'section' => 'sec_recent_frontpage',
'type' => 'text',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'recent_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
}//end woocommerce
/*------------------------------------------------------------------ Latest News */
$wp_customize->add_section(
'sec_latest_news_frontpage', array(
'title' => __( 'Latest News Setting', 'becommerce-store'),
'description' => __( 'Latest News Section', 'becommerce-store' ),
'panel' => 'frontpage_theme_option'
));
// Add our Checkbox switch setting and control for show cta
$wp_customize->add_setting( 'sec_latest_news_frontpage_show', array(
'transport' => 'refresh',
'sanitize_callback' => 'skyrocket_switch_sanitization',
'default' => BE\becommerce_store_generate_defaults('sec_latest_news_frontpage_show'),
));
$wp_customize->add_control( new Skyrocket_Toggle_Switch_Custom_control( $wp_customize, 'sec_latest_news_frontpage_show', array(
'label' => __( 'Show Latest News', 'becommerce-store' ),
'section' => 'sec_latest_news_frontpage'
)) );
$wp_customize->add_setting(
'set_latest_news_frontpage_title', array(
'type' => 'theme_mod',
'default' => BE\becommerce_store_generate_defaults('set_latest_news_frontpage_title'),
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
'set_latest_news_frontpage_title', array(
'label' => __( 'Title ', 'becommerce-store' ),
'section' => 'sec_latest_news_frontpage',
'type' => 'text',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'sec_latest_news_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
$wp_customize->add_setting(
'set_latest_news_frontpage_url', array(
'type' => 'theme_mod',
'default' => BE\becommerce_store_generate_defaults('set_latest_news_frontpage_url'),
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
'set_latest_news_frontpage_url', array(
'label' => __( 'Set URL ', 'becommerce-store' ),
'section' => 'sec_latest_news_frontpage',
'type' => 'text',
'active_callback' => function( $setting ) {
if ( $setting->manager->get_setting( 'sec_latest_news_frontpage_show' )->value() == 1 ) {
return true;
}
return false;
}
));
################################ End becommerce_store Frontpage Options ################################################
}
/**
* Load all our Customizer Custom Controls
*/
require_once trailingslashit( get_template_directory()) . 'admin/classes/custom-controls.php';
require_once trailingslashit( get_template_directory()) . 'admin/classes/library.php';
require_once trailingslashit( get_template_directory()) . 'admin/classes/handlers.php';
add_action( 'customize_register', 'becommerce_store_customizer' );