bh-widgets : The API
To add you own class the BH_Widget system you must implement the BH_Widget or BH_Controllable_Widget interfaces:
interface BH_Widget {
function __construct($name);
function widget($args);
}
interface BH_Controllable_Widget extends BH_Widget {
function control();
}
BH_Widget
The BH_Widget interface is for widgets that have no controls. Notice that it has a PHP5 type contructor. It takes a single parameter, name, which is a misnomer. This value will be the internal state of the widget. BH_Widget also has a widget method which, you might guess, renders the widget markup.
BH_Controllable_Widget
The BH_Controllable_Widget interface extends the BH_Widget interface and adds a control method, which should like in regualr wordpress widgets, it should save state for the widget and render the control form.
Lastly, the new class must registered. To do this, make a call to bh_widgets_register_class.
function bh_widgets_register_class($class_name, $x = 460, $y = 350);
This function has three parameters:
- name: name of the class you want to register.
- x: width of the control form in pixels(default is 460)
- y: height of the form in pixels (default is 350)









