<?php
/**
 * Customizer Basic Control.
 *
 * @package Purenote
 */

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

/**
 * Create a extend control with custom params.
 * This control allows you to add responsive settings.
 */
class Purenote_Customize_Control extends WP_Customize_Control {

    /**
     * Whitelisting the "required" argument.
     *
     * @since 1.0.0
     * @var array
     */
    public $required = array();

    /**
     * Refresh the parameters passed to the JavaScript via JSON.
     *
     * @see WP_Customize_Control::to_json()
     * @since 1.0.0
     */
    public function to_json() {
        parent::to_json();

        $this->json['required'] = $this->required;
    }
}


/**
 * Create a extend control with custom params.
 * This control allows you to add responsive settings.
 */
class Purenote_Customize_Color_Control extends WP_Customize_Color_Control {

    /**
     * Whitelisting the "required" argument.
     *
     * @since 1.0.0
     * @var array
     */
    public $required = array();

    /**
     * Renders the control wrapper and calls $this->render_content() for the internals.
     *
     * @since 3.4.0
     */
    /*protected function render() {
        $id    = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
        $class = 'customize-control customize-control-' . $this->type;

        printf( '<li id="%s" class="%s">', esc_attr( $id ), esc_attr( $class ) );
        $this->render_content();
        echo '</li>';
    }*/

    /**
     * To json data
     */
    public function to_json() {
        parent::to_json();

        $this->json['required'] = $this->required;
    }
}

/**
 * Create a extend control with custom params.
 * This control allows you to add responsive settings.
 */
class Purenote_Customize_Cropped_Image_Control extends WP_Customize_Cropped_Image_Control {

    /**
     * Whitelisting the "required" argument.
     *
     * @since 1.0.0
     * @var array
     */
    public $required = array();

    /**
     * To json data
     */
    public function to_json() {
        parent::to_json();

        $this->json['required'] = $this->required;
    }
}