Posted By

Ben on 02/13/10


Tagged

php wordpress widgets


Versions (?)

Multiple widgets


 / Published in: PHP
 

  1. <?php
  2. /**
  3.  * myWidget Class
  4.  */
  5. class myWidget extends WP_Widget {
  6. /** constructor */
  7. function myWidget() {
  8. parent::WP_Widget(false, $name = 'myWidget');
  9. }
  10.  
  11. /** @see WP_Widget::widget */
  12. function widget($args, $instance) {
  13. extract( $args );
  14. ?>
  15. <p>look at my widget code without all that before after widget stuff!</p>
  16. <?php
  17. }
  18. } // class myWidget
  19. ?>
  20. <?php
  21. // register myWidget widget
  22. add_action('widgets_init', create_function('', 'return register_widget("myWidget");'));
  23. ?>

Report this snippet  

You need to login to post a comment.