<?php
    /**
     * Media customzer custom control
     * 
     * @package Blog Bee
     * @since 1.0.0
     */
    namespace BBE\Customizer\Controls;

    use BBE\Customizer\Base as Base;

    use WP_Customize_Media_Control;
    
    if( ! class_exists( __NAMESPACE__ . '\\Media' ) ) {
        /**
         * Media Class
         */
        class Media extends WP_Customize_Media_Control {
            /**
             * Type of control
             * 
             * @since 1.0.0
             */
            public $type = 'media';

            /**
             * Conditions
             * 
             * @var array
             * @since 1.0.0
             */
            public $conditions = [];

            /**
             * Parameters to send
             * 
             * @since 1.0.0
             * @override 
             */
            public function to_json() {
                parent::to_json();
                $this->json[ 'conditions' ] = $this->conditions;
            }
        }
        Base::set_control_type( 'media', __NAMESPACE__ . '\\Media' );
    }