diff --git src/wp-admin/includes/user.php src/wp-admin/includes/user.php
index 5feb0b8..e31ca53 100644
|
|
function _wp_personal_data_export_page() { |
799 | 799 | $requests_table = new WP_Privacy_Data_Export_Requests_Table( array( |
800 | 800 | 'plural' => 'privacy_requests', |
801 | 801 | 'singular' => 'privacy_request', |
| 802 | 'screen' => 'export_personal_data', |
802 | 803 | ) ); |
803 | 804 | $requests_table->process_bulk_action(); |
804 | 805 | $requests_table->prepare_items(); |
… |
… |
function _wp_personal_data_removal_page() { |
870 | 871 | $requests_table = new WP_Privacy_Data_Removal_Requests_Table( array( |
871 | 872 | 'plural' => 'privacy_requests', |
872 | 873 | 'singular' => 'privacy_request', |
| 874 | 'screen' => 'remove_personal_data', |
873 | 875 | ) ); |
874 | 876 | |
875 | 877 | $requests_table->process_bulk_action(); |
… |
… |
abstract class WP_Privacy_Requests_Table extends WP_List_Table { |
984 | 986 | * @return array |
985 | 987 | */ |
986 | 988 | protected function get_sortable_columns() { |
987 | | return array(); |
| 989 | return array( |
| 990 | 'email' => 'requester', |
| 991 | 'created_timestamp' => 'requested', |
| 992 | ); |
988 | 993 | } |
989 | 994 | |
990 | 995 | /** |
… |
… |
abstract class WP_Privacy_Requests_Table extends WP_List_Table { |
1131 | 1136 | public function prepare_items() { |
1132 | 1137 | global $wpdb; |
1133 | 1138 | |
1134 | | $primary = $this->get_primary_column_name(); |
1135 | | $this->_column_headers = array( |
1136 | | $this->get_columns(), |
1137 | | array(), |
1138 | | $this->get_sortable_columns(), |
1139 | | $primary, |
1140 | | ); |
1141 | | |
1142 | 1139 | $this->items = array(); |
1143 | 1140 | $posts_per_page = 20; |
1144 | 1141 | $args = array( |
1145 | 1142 | 'post_type' => $this->post_type, |
1146 | 1143 | 'post_name__in' => array( $this->request_type ), |
1147 | 1144 | 'posts_per_page' => $posts_per_page, |
1148 | | 'offset' => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page: 0, |
1149 | 1145 | 'post_status' => 'any', |
1150 | | 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '', |
1151 | 1146 | ); |
1152 | 1147 | |
| 1148 | if ( isset( $_REQUEST['paged'] ) && (int) $_REQUEST['paged'] > 0 ) { |
| 1149 | $args['paged'] = (int) $_REQUEST['paged']; |
| 1150 | } |
| 1151 | |
| 1152 | $is_search = false; |
| 1153 | if ( isset( $_REQUEST['s'] ) && '' !== $_REQUEST['s'] ) { |
| 1154 | $args['s'] = sanitize_text_field( $_REQUEST['s'] ); |
| 1155 | $is_search = true; |
| 1156 | } |
| 1157 | |
| 1158 | $orderby_mapping = array( |
| 1159 | 'requester' => 'title', |
| 1160 | 'requested' => 'post_date_gmt', |
| 1161 | ); |
| 1162 | |
| 1163 | $orderby = ''; |
| 1164 | if ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) { |
| 1165 | $orderby = $orderby_mapping[ $_REQUEST['orderby'] ]; |
| 1166 | } elseif ( ! $is_search ) { // Don't override default search order by fields. |
| 1167 | $orderby = 'post_date_gmt'; |
| 1168 | } |
| 1169 | |
| 1170 | if ( $orderby ) { |
| 1171 | $args['orderby'] = $orderby; |
| 1172 | } |
| 1173 | |
| 1174 | $order = ''; |
| 1175 | if ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) { |
| 1176 | $order = strtoupper( $_REQUEST['order'] ); |
| 1177 | } elseif ( ! $is_search ) { // Don't override the default search order. |
| 1178 | if ( 'post_date_gmt' === $orderby ) { // Descending default date order. |
| 1179 | $order = 'DESC'; |
| 1180 | } else { |
| 1181 | $order = 'ASC'; |
| 1182 | } |
| 1183 | } |
| 1184 | |
| 1185 | if ( $order ) { |
| 1186 | $args['order'] = $order; |
| 1187 | } |
| 1188 | |
1153 | 1189 | if ( ! empty( $_REQUEST['filter-status'] ) ) { |
1154 | 1190 | $filter_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : ''; |
1155 | 1191 | $args['post_status'] = $filter_status; |