Changeset 44628
- Timestamp:
- 01/16/2019 05:51:56 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r44606 r44628 810 810 'plural' => 'privacy_requests', 811 811 'singular' => 'privacy_request', 812 'screen' => 'export_personal_data', 812 813 ) 813 814 ); … … 883 884 'plural' => 'privacy_requests', 884 885 'singular' => 'privacy_request', 886 'screen' => 'remove_personal_data', 885 887 ) 886 888 ); … … 1091 1093 */ 1092 1094 protected function get_sortable_columns() { 1093 return array(); 1095 // The initial sorting is by 'Requested' (post_date) and descending. 1096 // With initial sorting, the first click on 'Requested' should be ascending. 1097 // With 'Requester' sorting active, the next click on 'Requested' should be descending. 1098 $desc_first = isset( $_GET['orderby'] ); 1099 1100 return array( 1101 'email' => 'requester', 1102 'created_timestamp' => array( 'requested', $desc_first ), 1103 ); 1094 1104 } 1095 1105 … … 1236 1246 * 1237 1247 * @since 4.9.6 1248 * @since 5.1.0 Added support for column sorting. 1238 1249 */ 1239 1250 public function prepare_items() { 1240 1251 global $wpdb; 1241 1242 $primary = $this->get_primary_column_name();1243 $this->_column_headers = array(1244 $this->get_columns(),1245 array(),1246 $this->get_sortable_columns(),1247 $primary,1248 );1249 1252 1250 1253 $this->items = array(); … … 1258 1261 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '', 1259 1262 ); 1263 1264 $orderby_mapping = array( 1265 'requester' => 'post_title', 1266 'requested' => 'post_date', 1267 ); 1268 1269 if ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) { 1270 $args['orderby'] = $orderby_mapping[ $_REQUEST['orderby'] ]; 1271 } 1272 1273 if ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) { 1274 $args['order'] = strtoupper( $_REQUEST['order'] ); 1275 } 1260 1276 1261 1277 if ( ! empty( $_REQUEST['filter-status'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.