From a7e32691da598df0c8a8255a650d65d85c97fab9 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 25 Mar 2014 20:45:01 +1100 Subject: [PATCH] Create admin dashboard widget class --- includes/admin/class-sp-admin-dashboard.php | 77 +++++++++++++++++++++ includes/admin/class-sp-admin.php | 4 +- 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 includes/admin/class-sp-admin-dashboard.php diff --git a/includes/admin/class-sp-admin-dashboard.php b/includes/admin/class-sp-admin-dashboard.php new file mode 100644 index 00000000..bd0b5ee4 --- /dev/null +++ b/includes/admin/class-sp-admin-dashboard.php @@ -0,0 +1,77 @@ +post_date ); + $interval = date_diff( $now, $date ); + + $count = wp_count_posts( 'sp_event' ); + $scheduled_count = $count->future; + $published_count = $count->publish; + ?> + + id ) { case 'dashboard' : -// include( 'class-sp-admin-dashboard.php' ); + include( 'class-sp-admin-dashboard.php' ); break; case 'users' : case 'user' : @@ -76,7 +76,7 @@ class SP_Admin { } /** - * Prevent any user who cannot 'edit_posts' (subscribers, customers etc) from accessing admin + * Prevent any user who cannot 'edit_posts' (subscribers, fans etc) from accessing admin */ public function prevent_admin_access() { $prevent_access = false;