| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * @package Polylang | |
| 4 | + */ | |
| 2 | 5 | |
| 3 | 6 | if ( ! class_exists( 'WP_List_Table' ) ) { |
| 4 | 7 | require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; // since WP 3.1 |
| 5 | 8 | } |
| @@ -164,8 +167,16 @@ | ||
| 164 | 167 | * @param array $items |
| 165 | 168 | */ |
| 166 | 169 | public function prepare_items( $items = array() ) { |
| 167 | 170 | $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns(), $this->get_primary_column_name() ); |
| 171 | + | |
| 172 | + // Sort rows, lowest priority on top. | |
| 173 | + usort( | |
| 174 | + $items, | |
| 175 | + function( $a, $b ) { | |
| 176 | + return $a->priority > $b->priority ? 1 : -1; | |
| 177 | + } | |
| 178 | + ); | |
| 168 | 179 | $this->items = $items; |
| 169 | 180 | } |
| 170 | 181 | |
| 171 | 182 | /** |