Wordpress Widget Structure


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



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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.