Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class RequestCallback_Widget extends WP_Widget {
- function RequestCallback_Widget() {
- // widget actual processes
- parent::WP_Widget(false, $name = 'CEQ Why Choose Insurance Protector Box', array(
- 'description' => 'Display List of Reasons box'
- ));
- }
- function widget($args, $instance) {
- extract($args);
- $title = $instance['title'];
- $text = $instance['text'];
- ?>
- <div class="block block-more">
- <div class="content clearfix">
- <h4><?php echo $title; ?></h4>
- <p><?php echo $text ?></p>
- </div><!-- /.content -->
- </div><!-- /.block -->
- <?php
- }
- function update($new_instance, $old_instance) {
- $instance = $old_instance;
- $instance['title'] = strip_tags($new_instance['title']);
- $instance['text'] = strip_tags($new_instance['text']);
- return $instance;
- }
- function form($instance) {
- $instance = wp_parse_args( (array) $instance, array( 'title'=> 'Why Choose Insurance Protector ', 'text' => 'Arrange a call back to discuss your individual insurance requirements', 'link' => home_url( '/' ).'request-callback/',));
- $title = stripslashes($instance['title']);
- $text = stripslashes($instance['text']);
- ?>
- <p>
- <label for="<?php echo $this->get_field_id('title'); ?>">Title</label>
- <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" class="widefat" value="<?php echo $title; ?>" />
- </p>
- <p>
- <label for="<?php echo $this->get_field_id('text'); ?>">Text</label>
- <textarea id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>" cols="10" rows="8" class="widefat"><?php echo $text; ?></textarea>
- </p>
- <?php
- }
- }
- // register widget
- register_widget('WhyChooseIPG_Widget');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement