public function get_views() { $statuses = array('published' => __('My Forms', 'formidable'), 'template' => __('Templates', 'formidable'), 'draft' => __('Drafts', 'formidable'), 'trash' => __('Trash', 'formidable')); $links = array(); $counts = FrmForm::get_count(); $form_type = isset($_REQUEST['form_type']) ? sanitize_text_field($_REQUEST['form_type']) : 'published'; foreach ($statuses as $status => $name) { if ($status == $form_type) { $class = ' class="current"'; } else { $class = ''; } if ($counts->{$status} || 'published' == $status) { $links[$status] = '<a href="' . esc_url('?page=formidable&form_type=' . $status) . '" ' . $class . '>' . sprintf(__('%1$s <span class="count">(%2$s)</span>', 'formidable'), $name, number_format_i18n($counts->{$status})) . '</a>'; } unset($status, $name); } return $links; }