wp_refresh_heartbeat_nonces( array $response ): array

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


Parameters

$response array Required
The Heartbeat response.

Top ↑

Return

array The Heartbeat response.


Top ↑

Source

File: wp-admin/includes/misc.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.