heartbeat_nopriv_received
云策文档标注
概述
heartbeat_nopriv_received 是一个 WordPress 过滤器,用于在无权限环境中过滤 Heartbeat Ajax 响应。它允许开发者修改响应数据,基于传入的 POST 数据和屏幕 ID。
关键要点
- 这是一个过滤器 Hook,用于处理无权限(no-privilege)环境下的 Heartbeat API 响应。
- 接收三个参数:$response(响应数组)、$data($_POST 数据数组)和 $screen_id(屏幕 ID 字符串)。
- 在 wp_ajax_nopriv_heartbeat() 函数中使用,该函数位于 wp-admin/includes/ajax-actions.php 文件中。
- 自 WordPress 3.6.0 版本引入。
原文内容
Filters Heartbeat Ajax response in no-privilege environments.
Parameters
$responsearray-
The no-priv Heartbeat response.
$dataarray-
The $_POST data sent.
$screen_idstring-
The screen ID.
Source
$response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
Changelog
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |