public function calculate_totals()
{
/**
* @var $wpdb wpdb
*/
global $wpdb;
// Set totals
if (false !== $this->total_sql) {
$total = @current($wpdb->get_col($this->get_sql($this->total_sql)));
} else {
$total = @current($wpdb->get_col("SELECT FOUND_ROWS()"));
}
$total = $this->do_hook('select_total', $total);
$this->total_found = 0;
$this->total_found_calculated = true;
if (is_numeric($total)) {
$this->total_found = $total;
}
}