/**
  * Setup the final data for the table
  *
  * @access public
  * @since 1.5
  * @uses EDD_Customer_Reports_Table::get_columns()
  * @uses WP_List_Table::get_sortable_columns()
  * @uses EDD_Customer_Reports_Table::get_pagenum()
  * @uses EDD_Customer_Reports_Table::get_total_customers()
  * @return void
  */
 public function prepare_items()
 {
     $columns = $this->get_columns();
     $hidden = array();
     // No hidden columns
     $sortable = $this->get_sortable_columns();
     $this->_column_headers = array($columns, $hidden, $sortable);
     $this->items = $this->reports_data();
     $this->total = edd_count_total_customers();
     $this->set_pagination_args(array('total_items' => $this->total, 'per_page' => $this->per_page, 'total_pages' => ceil($this->total / $this->per_page)));
 }
Пример #2
0
<?php

// get the total count for... ALL THE THINGS - add to the list as you see fit
/**
 * Total number of published products
 *
 * @returns "# Products"
 */
$downloads_count = wp_count_posts('download');
echo $downloads_count->publish . ' Products';
/**
 * Total number of file downloads (all products... NOT user-based)
 *
 * @returns "# Downloads"
 */
function edd_count_total_file_downloads()
{
    global $edd_logs;
    return $edd_logs->get_log_count(null, 'file_download');
}
echo edd_count_total_file_downloads() . ' Downloads';
/**
 * Total number of customers (it's a core function but you know... easy to find here)
 *
 * @returns "# Customers"
 */
echo edd_count_total_customers() . ' Customers';