Advertisement
Guest User

whychooseipg-list.php

a guest
May 28th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. <?php
  2. class RequestCallback_Widget extends WP_Widget {
  3. function RequestCallback_Widget() {
  4. // widget actual processes
  5. parent::WP_Widget(false, $name = 'CEQ Why Choose Insurance Protector Box', array(
  6. 'description' => 'Display List of Reasons box'
  7. ));
  8. }
  9.  
  10. function widget($args, $instance) {
  11. extract($args);
  12. $title = $instance['title'];
  13. $text = $instance['text'];
  14.  
  15.  
  16. ?>
  17. <div class="block block-more">
  18. <div class="content clearfix">
  19. <h4><?php echo $title; ?></h4>
  20. <p><?php echo $text ?></p>
  21. </div><!-- /.content -->
  22.  
  23. </div><!-- /.block -->
  24. <?php
  25. }
  26.  
  27. function update($new_instance, $old_instance) {
  28. $instance = $old_instance;
  29. $instance['title'] = strip_tags($new_instance['title']);
  30. $instance['text'] = strip_tags($new_instance['text']);
  31. return $instance;
  32. }
  33.  
  34. function form($instance) {
  35. $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/',));
  36. $title = stripslashes($instance['title']);
  37. $text = stripslashes($instance['text']);
  38. ?>
  39. <p>
  40. <label for="<?php echo $this->get_field_id('title'); ?>">Title</label>
  41. <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; ?>" />
  42. </p>
  43. <p>
  44. <label for="<?php echo $this->get_field_id('text'); ?>">Text</label>
  45. <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>
  46. </p>
  47.  
  48. <?php
  49. }
  50. }
  51.  
  52. // register widget
  53. register_widget('WhyChooseIPG_Widget');
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement