wp_refresh_nonces
云策文档标注
概述
wp_refresh_nonces 是一个 WordPress 过滤器,用于在 New/Edit Post 屏幕中刷新 nonces。它允许开发者修改 Heartbeat API 响应中的 nonces 数据。
关键要点
- 过滤器名称:wp_refresh_nonces
- 用途:过滤发送到 New/Edit Post 屏幕的 nonces
- 参数:$response(Heartbeat 响应数组)、$data($_POST 数据数组)、$screen_id(屏幕 ID 字符串)
- 相关函数:wp_ajax_heartbeat() 用于处理 Heartbeat API 的 AJAX 请求
- 引入版本:WordPress 4.3.0
原文内容
Filters the nonces to send to the New/Edit Post screen.
Parameters
$responsearray-
The Heartbeat response.
$dataarray-
The $_POST data sent.
$screen_idstring-
The screen ID.
Source
$response = apply_filters( 'wp_refresh_nonces', $response, $data, $screen_id );
Changelog
| Version | Description |
|---|---|
| 4.3.0 | Introduced. |