blobaugh / inbox-status

Easy way to show your unread email count in WordPress themes
0 stars 1 forks source link

Create functions that retrieve unread/all emails that can be used in themes #5

Open blobaugh opened 11 years ago

blobaugh commented 11 years ago

Need to create a couple functions that can be used in themes. These functions will return only the number corresponding to the call. I.E: unread or all.

E.G: inbox_status_num_unread(); inbox_status_num_all();

These functions should interact with the BlobImap class to get he data, and utilize the site-wide options for server config.

pdclark commented 11 years ago

Added in this commit: Add actions for template output.

I used actions instead of functions. That way, if the plugin is disabled, the action just outputs nothing, instead of crashing the site.

Usage:

do_action( 'inbox_status_unread_count' );
do_action( 'inbox_status_total_count' );

There's also the shortcodes [unread-emails] and [total-emails].