-
Notifications
You must be signed in to change notification settings - Fork 0
/
class-email-widget.php
43 lines (32 loc) · 1.1 KB
/
class-email-widget.php
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
40
41
42
43
<?php
/**
* @author Ben Lobaugh <http://ben.lobaugh.net>
* @author Paul Clark <http://brainstormmedia.com>
*/
class IS_Email_Widget extends WP_Widget {
var $defaults = array(
'title' => '',
);
public function __construct() {
parent::WP_Widget( false, $name = __( 'Inbox Status – Email Count', 'inbox-status' ) );
}
/**
* Load widget HTML from WordPress Theme inbox-status-theme directory,
* or templates/inbox-status-theme/widget-email-count.php
*/
public function widget( $args, $instance ) {
$instance = wp_parse_args( $instance, $this->defaults );
$inbox = IS_Inbox_Status::get_instance();
$template_args = array_merge( $args, $instance );
$template_args['inbox'] = $inbox;
IS_Inbox_Status::get_template( 'widget-email-count', $template_args );
}
/**
* Load form HTML from templates/admin/widget-email-count-form.php
*/
public function form( $instance ) {
$instance = wp_parse_args( $instance, $this->defaults );
$template_args = array( 'widget' => $this, 'instance' => $instance, );
IS_Inbox_Status::get_template( 'widget-email-count-form', $template_args );
}
}