diff --git src/wp-admin/includes/user.php src/wp-admin/includes/user.php
index afbc2c8..5e4c575 100644
|
|
|
function _wp_personal_data_export_page() { |
| 798 | 798 | $requests_table = new WP_Privacy_Data_Export_Requests_Table( array( |
| 799 | 799 | 'plural' => 'privacy_requests', |
| 800 | 800 | 'singular' => 'privacy_request', |
| | 801 | 'screen' => 'export_personal_data', |
| 801 | 802 | ) ); |
| 802 | 803 | $requests_table->process_bulk_action(); |
| 803 | 804 | $requests_table->prepare_items(); |
| … |
… |
function _wp_personal_data_removal_page() { |
| 869 | 870 | $requests_table = new WP_Privacy_Data_Removal_Requests_Table( array( |
| 870 | 871 | 'plural' => 'privacy_requests', |
| 871 | 872 | 'singular' => 'privacy_request', |
| | 873 | 'screen' => 'remove_personal_data', |
| 872 | 874 | ) ); |
| 873 | 875 | |
| 874 | 876 | $requests_table->process_bulk_action(); |
| … |
… |
abstract class WP_Privacy_Requests_Table extends WP_List_Table { |
| 983 | 985 | * @return array |
| 984 | 986 | */ |
| 985 | 987 | protected function get_sortable_columns() { |
| 986 | | return array(); |
| | 988 | return array( |
| | 989 | 'email' => 'requester', |
| | 990 | 'created_timestamp' => 'requested', |
| | 991 | ); |
| 987 | 992 | } |
| 988 | 993 | |
| 989 | 994 | /** |
| … |
… |
abstract class WP_Privacy_Requests_Table extends WP_List_Table { |
| 1130 | 1135 | public function prepare_items() { |
| 1131 | 1136 | global $wpdb; |
| 1132 | 1137 | |
| 1133 | | $primary = $this->get_primary_column_name(); |
| 1134 | | $this->_column_headers = array( |
| 1135 | | $this->get_columns(), |
| 1136 | | array(), |
| 1137 | | $this->get_sortable_columns(), |
| 1138 | | $primary, |
| 1139 | | ); |
| 1140 | | |
| 1141 | 1138 | $this->items = array(); |
| 1142 | 1139 | $posts_per_page = 20; |
| 1143 | 1140 | $args = array( |
| 1144 | 1141 | 'post_type' => $this->post_type, |
| 1145 | 1142 | 'post_name__in' => array( $this->request_type ), |
| 1146 | 1143 | 'posts_per_page' => $posts_per_page, |
| 1147 | | 'offset' => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page: 0, |
| 1148 | 1144 | 'post_status' => 'any', |
| 1149 | | 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '', |
| 1150 | 1145 | ); |
| 1151 | 1146 | |
| | 1147 | if ( isset( $_REQUEST['paged'] ) && (int) $_REQUEST['paged'] > 0 ) { |
| | 1148 | $args['paged'] = (int) $_REQUEST['paged']; |
| | 1149 | } |
| | 1150 | |
| | 1151 | $is_search = false; |
| | 1152 | if ( isset( $_REQUEST['s'] ) && '' !== $_REQUEST['s'] ) { |
| | 1153 | $args['s'] = sanitize_text_field( $_REQUEST['s'] ); |
| | 1154 | $is_search = true; |
| | 1155 | } |
| | 1156 | |
| | 1157 | $orderby_mapping = array( |
| | 1158 | 'requester' => 'title', |
| | 1159 | 'requested' => 'post_date_gmt', |
| | 1160 | ); |
| | 1161 | |
| | 1162 | $orderby = ''; |
| | 1163 | |
| | 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['orderby'] ), array( 'ASC', 'DESC' ), true ) ) { |
| | 1176 | $order = strtoupper( $_REQUEST['orderby'] ); |
| | 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 | |
| 1152 | 1189 | if ( ! empty( $_REQUEST['filter-status'] ) ) { |
| 1153 | 1190 | $filter_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : ''; |
| 1154 | 1191 | $args['post_status'] = $filter_status; |