Skip to content

Instantly share code, notes, and snippets.

@mudrd8mz
Created November 3, 2015 21:19
Show Gist options
  • Save mudrd8mz/052ae818bf047dbf48cf to your computer and use it in GitHub Desktop.
Save mudrd8mz/052ae818bf047dbf48cf to your computer and use it in GitHub Desktop.
diff --git a/lib/tablelib.php b/lib/tablelib.php
index 06516e9..872ddc8 100644
--- a/lib/tablelib.php
+++ b/lib/tablelib.php
@@ -535,6 +535,9 @@ class flexible_table {
'i_last' => '',
'textsort' => $this->column_textsort,
);
+ if (!empty($this->sort_default_column)) {
+ $this->prefs['sortby'] = array($this->sort_default_column => $this->sort_default_order);
+ }
}
// Save user preferences if they have changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment