wp_refresh_heartbeat_nonces

Advertisement

Summery Summery

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

Syntax Syntax

wp_refresh_heartbeat_nonces( array $response )

Parameters Parameters

$response

(Required) The Heartbeat response.

Return Return

(array) The Heartbeat response.

Source Source

File: wp-admin/includes/misc.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Advertisement

Leave a Reply