wp_privacy_process_personal_data_erasure_page
函数
wp_privacy_process_personal_data_erasure_page ( $response, $eraser_index, $email_address, $page, $request_id )
- 参数
-
-
(array)
$response
The response from the personal data eraser for the given page.- Required: 是
-
(int)
$eraser_index
The index of the personal data eraser. Begins at 1.- Required: 是
-
(string)
$email_address
The email address of the user whose personal data this is.- Required: 是
-
(int)
$page
The page of personal data for this eraser. Begins at 1.- Required: 是
-
(int)
$request_id
The request ID for this personal data erasure.- Required: 是
-
(array)
- 返回值
-
- (array) The filtered response.
- 相关
-
- 定义位置
-
-
wp-admin/includes/privacy-tools.php
, line 916
-
wp-admin/includes/privacy-tools.php
- 引入
- 4.9.6
- 弃用
- –
Mark erasure requests as completed after processing is finished.
This intercepts the Ajax responses to personal data eraser page requests, and
monitors the status of a request. Once all of the processing has finished, the
request is marked as completed.
function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index, $email_address, $page, $request_id ) { /* * If the eraser response is malformed, don't attempt to consume it; let it * pass through, so that the default Ajax processing will generate a warning * to the user. */ if ( ! is_array( $response ) ) { return $response; } if ( ! array_key_exists( 'done', $response ) ) { return $response; } if ( ! array_key_exists( 'items_removed', $response ) ) { return $response; } if ( ! array_key_exists( 'items_retained', $response ) ) { return $response; } if ( ! array_key_exists( 'messages', $response ) ) { return $response; } // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'remove_personal_data' !== $request->action_name ) { wp_send_json_error( __( 'Invalid request ID when processing personal data to erase.' ) ); } /** This filter is documented in wp-admin/includes/ajax-actions.php */ $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() ); $is_last_eraser = count( $erasers ) === $eraser_index; $eraser_done = $response['done']; if ( ! $is_last_eraser || ! $eraser_done ) { return $response; } _wp_privacy_completed_request( $request_id ); /** * Fires immediately after a personal data erasure request has been marked completed. * * @since 4.9.6 * * @param int $request_id The privacy request post ID associated with this request. */ do_action( 'wp_privacy_personal_data_erased', $request_id ); return $response; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。