HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bt667/public_html/wp-content/themes/news-event/inc/customizer/base.php
<?php
/**
 * Custom Controls
 * 
 * @package News Event
 * @since 1.0.0
 */

if( class_exists( 'WP_Customize_Control' ) ) :
    // base control class
    class News_Event_WP_Base_Control extends \WP_Customize_Control {
        /**
         * List of controls for this theme.
         * 
         * @since 1.0.0
         */
        protected $type_array =  array();
        public $tab = 'general';

        /**
         * Add custom JSON parameters to use in the JS template.
         *
         * @since  1.0.0
         * @access public
         * @return void
         */
        public function to_json() {
            parent::to_json();
            $this->json['default'] = $this->setting->default;
            if( $this->tab && $this->type != 'section-tab' ) {
                $this->json['tab'] = $this->tab;
            }
        }

        /**
         * Generate the unique identifier for the control
         * 
         */
        function identifier_id() {
            return apply_filters( 'news_event_unique_identifier', $this->type );
        }
        /**
         * Override control's content.
         *
         */
        public function render_content() {
    ?>
            <div class="<?php echo esc_attr( $this->identifier_id() ); ?>" data-setting="<?php if( isset( $this->setting->id ) ) echo esc_attr( $this->setting->id ); ?>"></div>
    <?php
        }
    }
endif;