钩子文档

wp_privacy_personal_data_export_file_created

💡 云策文档标注

概述

wp_privacy_personal_data_export_file_created 是一个 WordPress 动作钩子,在个人数据导出文件创建完成后触发。它主要用于在导出过程中执行自定义操作,如日志记录或通知。

关键要点

  • 触发时机:所有个人数据写入导出文件后立即执行。
  • 参数:包括导出文件的路径、URL、HTML 和 JSON 报告路径,以及请求 ID。
  • 用途:允许开发者挂钩以处理导出文件,例如发送通知或进行额外处理。
  • 版本历史:从 WordPress 4.9.6 引入,5.4.0 版本添加了 $json_report_pathname 参数。

代码示例

do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname );

注意事项

  • 确保在挂钩函数中正确处理所有参数,以避免数据丢失或错误。
  • 此钩子与 wp_privacy_generate_personal_data_export_file() 函数相关,用于生成导出文件。

📄 原文内容

Fires right after all personal data has been written to the export file.

Parameters

$archive_pathnamestring
The full path to the export file on the filesystem.
$archive_urlstring
The URL of the archive file.
$html_report_pathnamestring
The full path to the HTML personal data report on the filesystem.
$request_idint
The export request ID.
$json_report_pathnamestring
The full path to the JSON personal data report on the filesystem.

Source

do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname );

Changelog

Version Description
5.4.0 Added the $json_report_pathname parameter.
4.9.6 Introduced.