Widget
class Widget extends WP_Widget
Properties
string | $id_base | Base ID for the widget, lower case, if left empty a portion of the widget's class name will be used. Has to be unique. | |
string | $name | Name for the widget displayed on the configuration page. | |
array | $widget_options | Optional. Passed to wp_register_sidebar_widget() | |
array | $control_options | Optional. Passed to wp_register_widget_control() | |
protected | $plugin | An instance of plugin. |
Methods
__construct(string $plugin)
Widget constructor.
array
defaults()
Return a key pairs array with the default value for widget.
widget(array $args, array $instance)
Echo the widget content.
viewWidget(array $args, array $instance)
Return the view resource path. eg: "widget.demo".
void
form(array $instance)
Echo the settings update form
string
viewForm($instance)
Return the view resource path. eg: "widget.form".
Details
at line 59
__construct(string $plugin)
Widget constructor.
at line 71
abstract array
defaults()
Return a key pairs array with the default value for widget.
at line 80
widget(array $args, array $instance)
Echo the widget content.
Subclasses should over-ride this function to generate their widget code.
at line 102
abstract
viewWidget(array $args, array $instance)
Return the view resource path. eg: "widget.demo".
at line 111
void
form(array $instance)
Echo the settings update form
at line 122
abstract string
viewForm($instance)
Return the view resource path. eg: "widget.form".