WordPress Widgets Helper Class


This is a little class that extends the built-in WP_Widget class to provide an easier start point to create Widgets. The code is well commented and haves a widget example, feel free to fork it or leave any suggestions.

View Class View Widget Example Download

Features

  • Automatic fields creation.
  • Validation methods.
  • Filter methods.
  • Before/After form output methods.

Check the inline comments and sample for more information. Thanks!

Reactions (3)

  1. Very good job. I like this idea but I think that it would be super important if you could provide a small tutorial on using this Widgets Helper Class. Thanks for sharing and mostly for your time.

  2. Joaquin

    Hey, thanks for this! I’m geting an error with the sample code supplied when I expanded the sample widget on my Sidebar widget area:

    Warning: _() expects exactly 1 parameter, 2 given in /home/website/wp-content/plugins/wph-widget-class.php on line 444
    Warning: _() expects exactly 1 parameter, 2 given in /home/website/wp-content/plugins/wph-widget-class.php on line 427
    Warning: _() expects exactly 1 parameter, 2 given in /home/website/wp-content/plugins/wph-widget-class.php on line 444
    Warning: _() expects exactly 1 parameter, 2 given in /home/website/wp-content/plugins/wph-widget-class.php on line 427
    

    any clues?

    Thanks again Matt,

    J