/** * Filter and sort the client history. * @param array $history * @return array */ public static function filter_client_history($history = array()) { $show_per_page = apply_filters('sc_client_history_records', 25); self::$total_pages = count($history) / $show_per_page; self::$current_page = isset($_REQUEST['history_page']) ? (int) $_REQUEST['history_page'] : 1; $start = self::$current_page > 1 ? self::$current_page * $show_per_page : 0; $history = array_slice($history, $start, $show_per_page, TRUE); krsort($history); return $history; }