'.sprintf( __( 'To use this section, you are required to first install the %1$s plugin', 'shop-isle' ), sprintf( '%s', esc_html__( 'WooCommerce', 'shop-isle' ) ) ).'
';
}
$wp_customize->add_section( 'shop_isle_products_section' , array(
'title' => __( 'Products section', 'shop-isle' ),
'description' => $shop_isle_require_woo,
'priority' => 43,
'panel' => 'shop_isle_front_page_sections'
));
/* Hide products */
$wp_customize->add_setting( 'shop_isle_products_hide', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control( 'shop_isle_products_hide', array(
'type' => 'checkbox',
'label' => __('Hide products section?','shop-isle'),
'description' => __('If you check this box, the Products section will disappear from homepage.','shop-isle'),
'section' => 'shop_isle_products_section',
'priority' => 1,
));
/* Title */
$wp_customize->add_setting( 'shop_isle_products_title', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'Latest products', 'shop-isle' )
));
$wp_customize->add_control( 'shop_isle_products_title', array(
'label' => __( 'Section title', 'shop-isle' ),
'section' => 'shop_isle_products_section',
'priority' => 2,
));
/* Shortcode */
$wp_customize->add_setting( 'shop_isle_products_shortcode', array(
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control( 'shop_isle_products_shortcode', array(
'label' => __( 'WooCommerce shortcode', 'shop-isle' ),
'section' => 'shop_isle_products_section',
'description' => __( 'Insert a WooCommerce shortcode', 'shop-isle' ),
'priority' => 3,
));
$shop_isle_prod_categories_array = array('-' => __('Select category','shop-isle'));
$shop_isle_prod_categories = get_categories( array('taxonomy' => 'product_cat', 'hide_empty' => 0, 'title_li' => '') );
if( !empty($shop_isle_prod_categories) ):
foreach ($shop_isle_prod_categories as $shop_isle_prod_cat):
if( !empty($shop_isle_prod_cat->term_id) && !empty($shop_isle_prod_cat->name) ):
$shop_isle_prod_categories_array[$shop_isle_prod_cat->term_id] = $shop_isle_prod_cat->name;
endif;
endforeach;
endif;
/* Category */
$wp_customize->add_setting( 'shop_isle_products_category', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control( 'shop_isle_products_category', array(
'type' => 'select',
'label' => __( 'Products category', 'shop-isle' ),
'description' => __( 'OR pick a product category. If no shortcode or no category is selected , WooCommerce latest products are displaying.', 'shop-isle' ),
'section' => 'shop_isle_products_section',
'choices' => $shop_isle_prod_categories_array,
'priority' => 4,
));
/****************************************/
/*********** Video section **************/
/****************************************/
$wp_customize->add_section( 'shop_isle_video_section' , array(
'title' => __( 'Video section', 'shop-isle' ),
'priority' => 44,
'panel' => 'shop_isle_front_page_sections'
));
/* Hide video */
$wp_customize->add_setting( 'shop_isle_video_hide', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control( 'shop_isle_video_hide', array(
'type' => 'checkbox',
'label' => __('Hide video section?','shop-isle'),
'description' => __('If you check this box, the Video section will disappear from homepage.','shop-isle'),
'section' => 'shop_isle_video_section',
'priority' => 1,
));
/* Title */
$wp_customize->add_setting( 'shop_isle_video_title', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'transport' => 'postMessage'
));
$wp_customize->add_control( 'shop_isle_video_title', array(
'label' => __( 'Title', 'shop-isle' ),
'section' => 'shop_isle_video_section',
'priority' => 2,
));
/* Youtube link */
$wp_customize->add_setting( 'shop_isle_yt_link', array(
'sanitize_callback' => 'esc_url'
));
$wp_customize->add_control( 'shop_isle_yt_link', array(
'label' => __( 'Youtube link', 'shop-isle' ),
'section' => 'shop_isle_video_section',
'priority' => 3,
));
/* Thumbnail */
$wp_customize->add_setting( 'shop_isle_yt_thumbnail', array(
'sanitize_callback' => 'esc_url'
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'shop_isle_yt_thumbnail', array(
'label' => 'Video thumbnail',
'description' => 'This image will appear while the video is downloading. If this is not included, the first frame of the video will be used instead.',
'section' => 'shop_isle_video_section',
'priority' => 4,
) ) );
/****************************************/
/******* Products slider section *******/
/****************************************/
$wp_customize->add_section( 'shop_isle_products_slider_section' , array(
'title' => __( 'Products slider section', 'shop-isle' ),
'description' => $shop_isle_require_woo,
'priority' => 45,
'panel' => 'shop_isle_front_page_sections'
));
/* Hide products slider on frontpage */
$wp_customize->add_setting( 'shop_isle_products_slider_hide', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control(
'shop_isle_products_slider_hide',
array(
'type' => 'checkbox',
'label' => __('Hide products slider section on frontpage?','shop-isle'),
'description' => __('If you check this box, the Products slider section will disappear from homepage.','shop-isle'),
'section' => 'shop_isle_products_slider_section',
'priority' => 1,
)
);
/* Hide products slider on single product page */
$wp_customize->add_setting( 'shop_isle_products_slider_single_hide', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control(
'shop_isle_products_slider_single_hide',
array(
'type' => 'checkbox',
'label' => __('Hide products slider section on single product page?','shop-isle'),
'description' => __('If you check this box, the Products slider section will disappear from each single product page.','shop-isle'),
'section' => 'shop_isle_products_slider_section',
'priority' => 2,
)
);
/* Title */
$wp_customize->add_setting( 'shop_isle_products_slider_title', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'Exclusive products', 'shop-isle' )
)
);
$wp_customize->add_control( 'shop_isle_products_slider_title', array(
'label' => __( 'Section title', 'shop-isle' ),
'section' => 'shop_isle_products_slider_section',
'priority' => 3,
));
/* Subtitle */
$wp_customize->add_setting( 'shop_isle_products_slider_subtitle', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text',
'default' => __( 'Special category of products', 'shop-isle' )
));
$wp_customize->add_control( 'shop_isle_products_slider_subtitle', array(
'label' => __( 'Section subtitle', 'shop-isle' ),
'section' => 'shop_isle_products_slider_section',
'priority' => 4,
));
/* Category */
$wp_customize->add_setting( 'shop_isle_products_slider_category', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control(
'shop_isle_products_slider_category',
array(
'type' => 'select',
'label' => __( 'Products category', 'shop-isle' ),
'section' => 'shop_isle_products_slider_section',
'choices' => $shop_isle_prod_categories_array,
'priority' => 5,
'description' => __( 'If no category is selected , WooCommerce products from the first category found are displaying.', 'shop-isle' )
)
);
/*******************************/
/*********** Footer ***********/
/*******************************/
$wp_customize->add_section( 'shop_isle_footer_section', array(
'title' => __( 'Footer', 'shop-isle' ),
'priority' => 50
) );
/* Copyright */
$wp_customize->add_setting( 'shop_isle_copyright', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
'transport' => 'postMessage'
));
$wp_customize->add_control( 'shop_isle_copyright', array(
'label' => __( 'Copyright', 'shop-isle' ),
'section' => 'shop_isle_footer_section',
'priority' => 1,
));
/* Hide site info */
$wp_customize->add_setting( 'shop_isle_site_info_hide', array(
'sanitize_callback' => 'shop_isle_sanitize_text'
));
$wp_customize->add_control(
'shop_isle_site_info_hide',
array(
'type' => 'checkbox',
'label' => __('Hide site info?','shop-isle'),
'description' => __('If you check this box, the Site info will disappear from footer.','shop-isle'),
'section' => 'shop_isle_footer_section',
'priority' => 2,
)
);
/* socials */
$wp_customize->add_setting( 'shop_isle_socials', array(
'transport' => 'postMessage',
'sanitize_callback' => 'shop_isle_sanitize_repeater'
));
$wp_customize->add_control( new Shop_Isle_Repeater_Controler( $wp_customize, 'shop_isle_socials', array(
'label' => __('Add new social','shop-isle'),
'section' => 'shop_isle_footer_section',
'priority' => 3,
'shop_isle_image_control' => false,
'shop_isle_link_control' => true,
'shop_isle_text_control' => false,
'shop_isle_subtext_control' => false,
'shop_isle_label_control' => false,
'shop_isle_icon_control' => true,
'shop_isle_description_control' => false,
'shop_isle_box_label' => __('Social','shop-isle'),
'shop_isle_box_add_label' => __('Add new social','shop-isle')
) ) );
/*********************************/
/****** Contact page ***********/
/*********************************/
$wp_customize->add_section( 'shop_isle_contact_page_section', array(
'title' => __( 'Contact page', 'shop-isle' ),
'priority' => 51
) );
/* Contact Form */
$wp_customize->add_setting( 'shop_isle_contact_page_form_shortcode', array(
'sanitize_callback' => 'shop_isle_sanitize_text',
));
$wp_customize->add_control( 'shop_isle_contact_page_form_shortcode', array(
'label' => __( 'Contact form shortcode', 'shop-isle' ),
'description' => sprintf(
__( 'Create a form, copy the shortcode generated and paste it here. We recommend %1$s but you can use any plugin you like.', 'shop-isle' ),
sprintf( '