<?php
/**
 * Custom HTML Section
 *
 * @package Minimal_Shop_Ecommerce
 */

$wp_customize->add_section(
	'tamal_portfolio_custom_html_section',
	array(
		'panel'    => 'tamal_portfolio_front_page_options',
		'title'    => esc_html__( 'Custom HTML', 'tamal-portfolio' ),
		'priority' => priority_section('tamal_portfolio_custom_html_section'),
	)
);

// About Section - Enable Section.
$wp_customize->add_setting(
	'tamal_portfolio_enable_custom_html_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'tamal_portfolio_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Tamal_Portfolio_Toggle_Switch_Custom_Control(
		$wp_customize,
		'tamal_portfolio_enable_custom_html_section',
		array(
			'label'    => esc_html__( 'Enable Custom HTML Section', 'tamal-portfolio' ),
			'section'  => 'tamal_portfolio_custom_html_section',
			'settings' => 'tamal_portfolio_enable_custom_html_section',
		)
	)
);

if ( isset( $wp_customize->selective_refresh ) ) {
	$wp_customize->selective_refresh->add_partial(
		'tamal_portfolio_enable_custom_html_section',
		array(
			'selector' => '#custom-html .section-link',
			'settings' => 'tamal_portfolio_enable_custom_html_section',
		)
	);
}

$wp_customize->add_setting(
    'tamal_portfolio_custom_html',
    array(
        'sanitize_callback' => 'wp_kses_post',
    )
);
$wp_customize->add_control( new Tamal_Portfolio_WP_Customize_TinyMCE_Control(
    $wp_customize,
    'tamal_portfolio_custom_html', array(
    'label'           => esc_html__( 'Custom', 'tamal-portfolio' ),
    'description'           => esc_html__( 'Custom html', 'tamal-portfolio' ),
    'section'     => 'tamal_portfolio_custom_html_section',
    'settings'    => 'tamal_portfolio_custom_html',
    'type'        => 'textarea',
    'input_attrs' => [
//        'toolbar1'     => 'formatselect bold italic link bullist',
        'height'       => 300,
        'mediaButtons' => true,
    ],
    'active_callback' => 'tamal_portfolio_is_custom_html_section_enabled',
) ) );