HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpprotonperinggit/wp-content/themes/voiture/inc/widgets/listing-buttons.php
<?php

class Voiture_Widget_Listing_Buttons extends WP_Widget {
    public function __construct() {
        parent::__construct(
            'apus_listing_buttons',
            esc_html__('Listing Detail:: Buttons', 'voiture'),
            array( 'description' => esc_html__( 'Show listing buttons', 'voiture' ), )
        );
        $this->widgetName = 'listing_buttons';
    }
    
    public function widget( $args, $instance ) {
        get_template_part('widgets/listing-buttons', '', array('args' => $args, 'instance' => $instance));
    }
    
    public function form( $instance ) {
        $defaults = array(
            'title' => '',
            'show_make_an_offer_button' => 1,
            'make_an_offer_text' => 'Make An Offer Price',
            'show_schedule_test_drive' => 1,
            'schedule_test_drive_text' => 'View VIN report',
        );
        $instance = wp_parse_args((array) $instance, $defaults);
        // Widget admin form
        ?>
        <p>
            <label for="<?php echo esc_attr($this->get_field_id( 'title' )); ?>"><?php esc_html_e( 'Title:', 'voiture' ); ?></label>
            <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'title' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'title' )); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
        </p>

        <p>
            <input class="checkbox" type="checkbox" <?php checked( $instance['show_make_an_offer_button'], 1 ); ?> id="<?php echo esc_attr( 'show_make_an_offer_button' ); ?>" name="<?php echo esc_attr($this->get_field_name('show_make_an_offer_button')); ?>" value="1"/>
            <label for="<?php echo esc_attr($this->get_field_name('show_make_an_offer_button') ); ?>">
                <?php esc_html_e('Show Make An Offer Price Button', 'voiture'); ?>
            </label>
        </p>
        <p>
            <label for="<?php echo esc_attr($this->get_field_id( 'make_an_offer_text' )); ?>"><?php esc_html_e( 'Make An Offer Price Text:', 'voiture' ); ?></label>
            <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'make_an_offer_text' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'make_an_offer_text' )); ?>" type="text" value="<?php echo esc_attr( $instance['make_an_offer_text'] ); ?>" />
        </p>

        <p>
            <input class="checkbox" type="checkbox" <?php checked( $instance['show_schedule_test_drive'], 1 ); ?> id="<?php echo esc_attr( 'show_schedule_test_drive' ); ?>" name="<?php echo esc_attr($this->get_field_name('show_schedule_test_drive')); ?>" value="1"/>
            <label for="<?php echo esc_attr($this->get_field_name('show_schedule_test_drive') ); ?>">
                <?php esc_html_e('Show Schedule Test Drive Button', 'voiture'); ?>
            </label>
        </p>

        <p>
            <label for="<?php echo esc_attr($this->get_field_id( 'schedule_test_drive_text' )); ?>"><?php esc_html_e( 'Schedule Test Drive Text:', 'voiture' ); ?></label>
            <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'schedule_test_drive_text' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'schedule_test_drive_text' )); ?>" type="text" value="<?php echo esc_attr( $instance['schedule_test_drive_text'] ); ?>" />
        </p>
        <?php
    }

    public function update( $new_instance, $old_instance ) {
        $instance = array();
        $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
        $instance['show_make_an_offer_button'] = (isset( $new_instance['show_make_an_offer_button'] ) ) ? strip_tags( $new_instance['show_make_an_offer_button'] ) : '';
        $instance['make_an_offer_text'] = (isset( $new_instance['make_an_offer_text'] ) ) ? strip_tags( $new_instance['make_an_offer_text'] ) : '';
        $instance['show_schedule_test_drive'] = (isset( $new_instance['show_schedule_test_drive'] ) ) ? strip_tags( $new_instance['show_schedule_test_drive'] ) : '';
        $instance['schedule_test_drive_text'] = (isset( $new_instance['schedule_test_drive_text'] ) ) ? strip_tags( $new_instance['schedule_test_drive_text'] ) : '';
        return $instance;
    }
}
call_user_func( implode('_', array('register', 'widget') ), 'Voiture_Widget_Listing_Buttons' );