钩子文档

wp_privacy_personal_data_erasure_page

💡 云策文档标注

概述

wp_privacy_personal_data_erasure_page 是一个 WordPress 过滤器钩子,用于过滤个人数据擦除页面的响应数据。它允许在 Ajax 之外的其他目的地使用擦除响应。

关键要点

  • 过滤器钩子:wp_privacy_personal_data_erasure_page
  • 主要用途:过滤个人数据擦除器的响应数组,支持非 Ajax 场景
  • 参数包括:$response(响应数组)、$eraser_index(擦除器索引)、$email_address(邮箱地址)、$page(页码)、$request_id(请求ID)、$eraser_key(擦除器键)
  • 响应数组结构:包含 items_removed、items_retained、messages、done 等字段
  • 引入版本:WordPress 4.9.6

代码示例

$response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key );

注意事项

  • 此钩子与 wp_ajax_wp_privacy_erase_personal_data() 函数相关,用于处理个人数据擦除的 Ajax 请求
  • 开发者应确保响应数组格式正确,以兼容 WordPress 隐私数据处理流程

📄 原文内容

Filters a page of personal data eraser data.

Description

Allows the erasure response to be consumed by destinations in addition to Ajax.

Parameters

$responsearray
The personal data for the given exporter and page number.

  • items_removed bool
    Whether items were actually removed or not.
  • items_retained bool
    Whether items were retained or not.
  • messages string[]
    An array of messages to add to the personal data export file.
  • done bool
    Whether the eraser is finished or not.

$eraser_indexint
The index of the eraser that provided this data.
$email_addressstring
The email address associated with this personal data.
$pageint
The page number for this response.
$request_idint
The privacy request post ID associated with this request.
$eraser_keystring
The key (slug) of the eraser that provided this data.

Source

$response = apply_filters( 'wp_privacy_personal_data_erasure_page', $response, $eraser_index, $email_address, $page, $request_id, $eraser_key );

Changelog

Version Description
4.9.6 Introduced.