| 1 |
<?php |
| 2 |
|
| 3 |
// add filter for the stats structure |
| 4 |
add_filter('mmb_stats_filter', mmb_extra_html_example); |
| 5 |
|
| 6 |
function mmb_extra_html_example($stats) |
| 7 |
{ |
| 8 |
$count_posts = wp_count_posts(); |
| 9 |
|
| 10 |
$published_posts = $count_posts->publish; |
| 11 |
|
| 12 |
// add 'extra_html' element. This is what gets displayed in the dashboard |
| 13 |
$stats['extra_html'] = '<p>Hello from '.get_bloginfo('name').' with '.$published_posts.' published posts.</p>'; |
| 14 |
|
| 15 |
// return the whole array back |
| 16 |
return $stats; |
| 17 |
} |
| 18 |
?> |