'theme-widget', // class of the
holder
'description' => __( 'Displays a block with title/text' ) // description shown in the widget list
);
// widget id, widget display title, widget options
$this->WP_Widget('theme-widget-example', 'Theme Widget - Example', $widget_opts);
$this->custom_fields = array(
array(
'name'=>'title', // field name
'type'=>'text', // field type (text, textarea, integer etc.)
'title'=>'Title', // title displayed in the widget form
'default'=>'Hello World!' // default value
),
array(
'name'=>'text',
'type'=>'textarea',
'title'=>'Content',
'default'=>'Lorem Ipsum dolor sit amet'
),
);
}
/*
* Called when rendering the widget in the front-end
*/
function front_end($args, $instance) {
?>