Tag Archive: widgets
Blurbette Plugin: Widget
Creating a widget is very simple, because WordPress provides a WP_Widget class you can simply extend and define. Four methods are required:
__construct(): the constructor which simply defines some strings and calls the parent method, form(): presents the draggable widget form in the admin panel, update(): operates when the form is updated, widget(): performs the output in the sidebar.I’ll discuss each of the four ...
Blurbette Plugin: Shortcode
The next class in our blueprint is the shortcode — the workhorse of the blurbette.
I’ll be sure to relegate all blurbette output to this shortcode, so proper control can be maintained and code isn’t duplicated elsewhere. In other words, if some other code wants to output a blurbette directly, it can call do_shortcode( '[blurbette id="1234"]' );.
First, I’ll design the shortcode. ...