Advertisement
wdtobibur

Custom Widgets Form Function

Oct 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. function form( $instance ) {
  2. /* Set up some default widget settings. */
  3. $defaults = array( 'title' => 'TAG CLOUD', 'number' => '10', 'small' => '8', 'large' => '12');
  4. $instance = wp_parse_args( (array) $instance, $defaults );
  5. ?>
  6. <p>
  7. <label for="<?php echo $this->get_field_id( 'title' ); ?>">
  8. <?php _e('Title:', 'fabulous') ?>
  9. </label>
  10. <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />
  11. </p>
  12.  
  13. <p>
  14. <label for="<?php echo $this->get_field_id( 'number' ); ?>">
  15. <?php _e('Number:', 'fabulous') ?>
  16. </label>
  17. <input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" value="<?php echo $instance['number']; ?>" style="width:100%;" />
  18. </p>
  19.  
  20. <p>
  21. <label for="<?php echo $this->get_field_id( 'small' ); ?>">
  22. <?php _e('Smallest:', 'fabulous') ?>
  23. </label>
  24. <input id="<?php echo $this->get_field_id( 'small' ); ?>" name="<?php echo $this->get_field_name( 'small' ); ?>" value="<?php echo $instance['small']; ?>" style="width:100%;" />
  25. </p>
  26.  
  27. <p>
  28. <label for="<?php echo $this->get_field_id( 'large' ); ?>">
  29. <?php _e('Largest:', 'fabulous') ?>
  30. </label>
  31. <input id="<?php echo $this->get_field_id( 'large' ); ?>" name="<?php echo $this->get_field_name( 'large' ); ?>" value="<?php echo $instance['large']; ?>" style="width:100%;" />
  32. </p>
  33.  
  34. <?php
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement