• File: customizer-custom-control.php
  • Full Path: /home/havejqku/public_html/wp-admin/e0506b/wp-content/themes/tourio/inc/customizer/customizer-custom-control.php
  • Date Modified: 09/10/2025 7:10 PM
  • File size: 2.45 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

if ( class_exists( 'WP_Customize_Control' ) ) {
    class Tourio_WP_Customize_Radio_Image_Control extends WP_Customize_Control {
        public $type = 'tourio_radio_image';
        
        /**
         * Enqueue our scripts and styles
         */
        public function enqueue() {
            wp_enqueue_style( 'tourio-customizer', get_template_directory_uri() . '/inc/customizer/css/customizer.css', array(), '1.1', 'all' );
        }

        public function render_content() {

            ?>
            <label>
                <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
            </label>
            <?php if ( !empty($this->description) ) { ?>
                <span class="description customize-control-description"><?php echo trim($this->description); ?></span>
            <?php } ?>
            <?php if ( !empty($this->choices) ) { ?>
                <div class="options image_radio_button_control">
                    <?php foreach ($this->choices as $key => $option) { ?>
                        <div class="item radio-button-label">
                            <label>
                                <input type="radio" value="<?php echo esc_attr($key); ?>" <?php $this->link(); ?> <?php checked($this->value(), $key, true); ?> name="_customize-<?php echo esc_attr($this->type); ?>-<?php echo esc_attr($this->id); ?>">
                                <?php if ( $option['img'] ) { ?>
                                    <img src="<?php echo esc_url($option['img']); ?>" alt="<?php echo esc_attr($option['title']); ?>">
                                <?php } ?>
                                <span class="title"><?php echo esc_html($option['title']); ?></span>
                            </label>
                        </div>
                    <?php } ?>
                </div>

                <?php
            }
        }


    }


    class Tourio_WP_Customize_Heading_Control extends WP_Customize_Control {
        public $type = 'tourio_heading';
 
        public function render_content() {

            ?>
            <h4 class="customize-heading-custom">
                <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
            </h4>
            <?php if ( !empty($this->description) ) { ?>
                <span class="description customize-control-description"><?php echo trim($this->description); ?></span>
            <?php } ?>
            <hr>
            <?php
        }
    }
}