wp_refresh_heartbeat_nonces

函数
wp_refresh_heartbeat_nonces ( $response )
参数
  • (array) $response The Heartbeat response.
    Required:
返回值
  • (array) The Heartbeat response.
定义位置
相关方法
wp_refresh_post_nonceswp_refresh_metabox_loader_nonceswp_refresh_post_lockwp_create_noncewp_ajax_heartbeat
引入
5.0.0
弃用
-

wp_refresh_heartbeat_nonces: 这个函数用来刷新WordPress heartbeat API使用的nonces,它负责后台AJAX请求。

将最新的Heartbeat 和REST-API nonce添加到Heartbeat 响应中。

function wp_refresh_heartbeat_nonces( $response ) {
	// Refresh the Rest API nonce.
	$response['rest_nonce'] = wp_create_nonce( 'wp_rest' );

	// Refresh the Heartbeat nonce.
	$response['heartbeat_nonce'] = wp_create_nonce( 'heartbeat-nonce' );

	return $response;
}

常见问题

FAQs
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-19 10:27:51

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: