<?php
 function howcan_header_img ($wp_customize){
    // header image button section 
     $wp_customize->add_section( 'header_img_button', array(
        'title'    => __( 'Header / Hero Image', 'howcan' ),
        'priority' => 10,
         'panel'    => 'howcan_theme_options_panel'
    ) );
    
    
    // text color 
    $wp_customize->add_setting('howcan_header_img_text_color', [
        'default'   => __('#fff', 'howcan'),
        'sanitize_callback' => 'sanitize_text_field',
    ]);
   
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'howcan_header_img_text_color', array(
        'label'    => __('Header Image Text Color', 'howcan'),
        'section'  => 'header_img_button',
    )));

    
    // button text 
    $wp_customize->add_setting('howcan_header_img_button_text', [
        'default'   => __('Download Now', 'howcan'),
        'sanitize_callback' => 'sanitize_text_field',
    ]);
    $wp_customize->add_control('howcan_header_img_button_text', [
        'label'   => __('Header Image  Button Text  Change', 'howcan'),
        'section' => 'header_img_button',
        'type'    => 'text',
    ]);
    
    
    // button action 
    
     $wp_customize->add_setting('howcan_header_img_button_link', [
        'default'   => __('#', 'howcan'),
        'sanitize_callback' => 'sanitize_text_field',
    ]);
    $wp_customize->add_control('howcan_header_img_button_link', [
        'label'   => __('Header Image  Button Link  Change', 'howcan'),
        'section' => 'header_img_button',
        'type'    => 'url',
    ]);
    
    // header imge button  Background Color
    $wp_customize->add_setting('header_img_button_bg_color', array(
        'default'           => '#000',
        'sanitize_callback' => 'sanitize_hex_color',
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_img_button_bg_color', array(
        'label'    => __('Button Background Color', 'howcan'),
        'section'  => 'header_img_button',
    )));

    
    
    // header imge button  text Color
    $wp_customize->add_setting('header_img_button_text_color', array(
        'default'           => '#fff',
        'sanitize_callback' => 'sanitize_hex_color',
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_img_button_text_color', array(
        'label'    => __('Button Text Color', 'howcan'),
        'section'  => 'header_img_button',
    )));

    
    // Show/Hide header image button 
    $wp_customize->add_setting('howcan_headerimg_button_enable', array(
        'default'           => false,
        'sanitize_callback' => 'wp_validate_boolean',
    ));
    $wp_customize->add_control('howcan_headerimg_button_enable', array(
        'label'    => __('Enable Header Image Button ', 'howcan'),
        'section'  => 'header_img_button',
        'type'     => 'checkbox',
    ));
}
    add_action('customize_register','howcan_header_img');