Uname: Linux premium72.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.2.29 [ PHP INFO ] PHP os: Linux
Server Ip: 198.54.125.95
Your Ip: 216.73.216.112
User: matican (532) | Group: matican (531)
Safe Mode: OFF
Disable Function:
NONE

name : rs_cta.php
<?php 
// Register and load the widget
function rsframework_cta_widget() {
    register_widget( 'cta_widget' );
}
add_action( 'widgets_init', 'rsframework_cta_widget' );

//Contact info Widget 
class cta_widget extends WP_Widget {
 
   /** constructor */
   function __construct() {
    parent::__construct(
      'cta_widget', 
      __('RS CTA Info', 'rsframework'),
      array( 'description' => __( 'Display your cta info!', 'rsframework' ), )
    );
  }
 
    /** @see WP_Widget::widget */
    function widget($args, $instance) { 
        extract( $args );
        $image_src = '';
        $title    = apply_filters('widget_title', $instance['title']);        
        $phone   = $instance['phone'];
        $app   = $instance['app'];
      
        
  
 
    if (!empty($intro) || !empty($phone)){ ?>
    <!-- Contact Info Widget -->
        <div class="cta-widget">
            <div class="container">
                <div class="title-cta">
                    <h2><?php echo wp_kses_post($title); ?></h2>                    
                    <?php         
                        if (!empty($phone)){
                            echo '<a class="cta-button" href="'. esc_attr(str_replace(" ","", ($app))) .'">'. esc_html($phone) .'</a>';
                        }
                    ?>                    
                </div>
            </div>
        </div>
    <?php } ?>    

    
    <?php
    }
 
  /** @see WP_Widget::update  */
  function update($new_instance, $old_instance) {   
      $instance            = $old_instance;
      $instance['title']   = strip_tags($new_instance['title']);
      $instance['phone']   = strip_tags($new_instance['phone']);
      $instance['app']     = wp_kses_post($new_instance['app']); 
     
      $instance['url']     = strip_tags($new_instance['url']);      
      return $instance;
    }
 
    /** @see WP_Widget::form */
    function form($instance) {  

       $title   = (isset($instance['title']))? $instance['title'] : '';      
       $phone   = (isset($instance['phone']))? $instance['phone'] : '';
       $app     = (isset($instance['app']))? $instance['app'] : '';       

     ?>  

        <p>
          <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'rsframework'); ?></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_js( $title); ?>" />
        </p> 

        <p>
          <label for="<?php echo esc_attr($this->get_field_id('phone')); ?>"><?php esc_html_e('Button:', 'rsframework'); ?></label> 
          <input class="widefat" id="<?php echo esc_attr($this->get_field_id('phone')); ?>" name="<?php echo esc_attr($this->get_field_name('phone')); ?>" type="text" value="<?php echo esc_js($phone); ?>" />
        </p>
        

        <p>
          <label for="<?php echo esc_attr($this->get_field_id('app')); ?>"><?php esc_html_e('Link:', 'rsframework'); ?></label> 
          <input class="widefat" id="<?php echo esc_attr($this->get_field_id('app')); ?>" name="<?php echo esc_attr($this->get_field_name('app')); ?>" type="text" value="<?php echo esc_js($app); ?>" />
        </p>     
       
        <?php 
    }

 
} // end class
© 2025 XylotrechusZ