wp_refresh_heartbeat_nonces()
Adds the latest Heartbeat and REST API nonce to the Heartbeat response.
No Hooks.
Returns
Array. The Heartbeat response.
Usage
wp_refresh_heartbeat_nonces( $response );
- $response(array) (required)
- The Heartbeat response.
Changelog
| Since 5.0.0 | Introduced. |
wp_refresh_heartbeat_nonces() wp refresh heartbeat nonces code WP 6.9
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;
}