-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.php
More file actions
39 lines (27 loc) · 811 Bytes
/
widget.php
File metadata and controls
39 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
class Simplewidget extends WP_Widget
{
function SimpleWidget(){
$widget_options= array(
'classname' => 'simple-widget',
'description' =>'Just a simple widgets');
parent::WP_Widget('simple_widget','Simple Widget',$widget_options);
}
function widget($args,$instance){
extract($args,EXTR_SKIP);
$title($instance ['body']) ? $instance['title'] : 'A simnple widget';
$body = ($instance['body']) ? $instance['body'] : 'a simple message';
echo $before_widget;
echo $before_title . $title . $after_title;
echo $body;
}
function update(){
}
function form(){
}
}
function simple_widget_init(){
register_widget("SimpleWidget");
}
add_action('widgets_init','simpl_widget_init');
?>