<?php

if( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

$prefix = BREEK_LITE_THEMEPREFIX . '_';

/* Subscribe Section */
$wp_customize->add_section( $prefix . 'subscribe_section', array(
    'title'       => esc_html_x( 'Subscribe', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Configure subscription settings for header.', 'admin', 'breek-lite' ),
    'priority'    => 40,
));

// Display Subscribe Button on Header
$wp_customize->add_setting( $prefix . 'header_enable_subscribe', array(
    'default'           => '0',
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control( $prefix . 'header_enable_subscribe', array(
    'label'       => esc_html_x( 'Display subscribe button on Header', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'subscribe_section',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));

// Title of Subscribe Button
$wp_customize->add_setting( $prefix . 'title_subscribe_button', array(
    'default'           => esc_html_x( 'Subscribe', 'admin', 'breek-lite' ),
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control( $prefix . 'title_subscribe_button', array(
    'label'       => esc_html_x( 'Title of subscribe button (header)', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'e.g. Join', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'subscribe_section',
    'type'        => 'text',
));

// Subscribe URL (Global)
$wp_customize->add_setting( $prefix . 'subscribe_url', array(
    'default'           => '',
    'sanitize_callback' => 'esc_url_raw',
));

$wp_customize->add_control( $prefix . 'subscribe_url', array(
    'label'       => esc_html_x( 'Subscribe URL', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'e.g. https://estudiopatagon.com/subscribe', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'subscribe_section',
    'type'        => 'url',
));  