wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_refresh_heartbeat_nonces › WordPress Function

Since5.0.0
Deprecatedn/a
wp_refresh_heartbeat_nonces ( $response )
Parameters:
  • (array) $response The Heartbeat response.
    Required: Yes
Returns:
  • (array) The Heartbeat response.
Defined at:
Codex:

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



Source

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