Create a Wordpress 2.8+ Widget


/ Published in: PHP
Save to your folder(s)

Full example widget available at [WP Engineer](http://wpengineer.com/wordpress-built-a-widget/ "Build A WordPress 2.8 Widget With The New Widget API").


Copy this code and paste it in your HTML
  1. class My_RSS_Widget extends WP_Widget {
  2. function My_RSS_Widget() {
  3. //Constructor
  4. }
  5.  
  6. function widget($args, $instance) {
  7. // prints the widget
  8. }
  9.  
  10. function update($new_instance, $old_instance) {
  11. //save the widget
  12. }
  13.  
  14. function form($instance) {
  15. //widgetform in backend
  16. }
  17. }
  18. register_widget('My_RSS_Widget');

URL: http://wpengineer.com/wordpress-built-a-widget/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.