wp_refresh_heartbeat_nonces()WP 5.0.0

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

Хуков нет.

Возвращает

Массив. The Heartbeat response.

Использование

wp_refresh_heartbeat_nonces( $response );
$response(массив) (обязательный)
The Heartbeat response.

Список изменений

С версии 5.0.0 Введена.

Код wp_refresh_heartbeat_nonces() WP 6.5.2

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