wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_refresh_heartbeat_nonces › WordPress Function

Since5.0.0
已弃用n/a
wp_refresh_heartbeat_nonces ( $response )
参数:
  • (array) $response The Heartbeat response.
    Required: Yes
返回:
  • (array) The Heartbeat response.
定义在:
文档:

Adds the latest Heartbeat and REST-API nonce to the Heartbeat response.



源码

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;
}