<?php

$default = darkmag_get_default_theme_options();
/**
* Add Header Top Panel
*/
$wp_customize->add_panel( 'header_top_panel', array(
    'title'          => __( 'Header Top', 'darkmag' ),
    'priority'       => 20,
    'capability'     => 'edit_theme_options',
) );

/** Header social links section */
$wp_customize->add_section(
    'header_social_links_section',
    array(
        'title'    => __( 'Social Links', 'darkmag' ),
        'panel'    => 'header_top_panel',
        'priority' => 20,
    )
);

// Setting social_links.
$wp_customize->add_setting( 
    'theme_options[social_link_1]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_1]',
    array(
        'label'           => __( 'Social Link 1', 'darkmag' ),
        'description'     => __( 'Enter valid url.', 'darkmag' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
    )
);

$wp_customize->add_setting( 
    'theme_options[social_link_2]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_2]',
    array(
        'label'           => __( 'Social Link 2', 'darkmag' ),
        'description'     => __( 'Enter valid url.', 'darkmag' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
    )
);
$wp_customize->add_setting( 
    'theme_options[social_link_3]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_3]',
    array(
        'label'           => __( 'Social Link 3', 'darkmag' ),
        'description'     => __( 'Enter valid url.', 'darkmag' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
    )
);

// Advertisement Section
$wp_customize->add_section(
    'header_advertisement_section',
    array(
        'title'    => __( 'Advertisement', 'darkmag' ),
        'panel'    => 'header_top_panel',
        'priority' => 20,
    )
);

// Advertisement Image
$wp_customize->add_setting( 'theme_options[advertisement_image]', array(
    'sanitize_callback' => 'darkmag_sanitize_image'
) );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'theme_options[advertisement_image]',
    array(
        'label'             => esc_html__( 'Advertisement Image', 'darkmag' ),
        'description'       => sprintf( esc_html__( 'Recommended size: 800px x 90px ', 'darkmag' ), 810, 120 ),
        'section'           => 'header_advertisement_section',
    ) 
) );

// Advertisement Link
$wp_customize->add_setting( 'theme_options[advertisement_url]', array(
    'sanitize_callback' => 'esc_url_raw',
) );

$wp_customize->add_control( 'theme_options[advertisement_url]', array(
    'label'             => esc_html__( 'Advertisement Url', 'darkmag' ),
    'section'           => 'header_advertisement_section',
    'type'              => 'url',
) );