publish ); $post_type = get_post_type_object( $type ); $text = _n( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $published, 'your_textdomain' ); $text = sprintf( $text, number_format_i18n( $published ) ); if ( current_user_can( $post_type->cap->edit_posts ) ): $output = '' . $text . ''; echo '
  • ' . $output . '
  • '; else: $output = '' . $text . ''; echo '
  • ' . $output . '
  • '; endif; endif; endforeach; return $items; } /** * Show status widget */ public function status_widget() { $next_event = sp_get_next_event(); $now = new DateTime( current_time( 'mysql', 0 ) ); $date = new DateTime( $next_event->post_date ); $interval = date_diff( $now, $date ); $count = wp_count_posts( 'sp_event' ); $scheduled_count = $count->future; $published_count = $count->publish; ?>