wp_refresh_heartbeat_nonces

函数


wp_refresh_heartbeat_nonces ( $response )
参数
  • (array)
    $response
    The Heartbeat response.
    Required:
返回值
  • (array) The Heartbeat response.
定义位置
  • wp-admin/includes/misc.php
    , line 1301
引入
5.0.0
弃用

将最新的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;
}