wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_refresh_heartbeat_nonces › WordPress Function

Depuis5.0.0
Dépréciéen/a
wp_refresh_heartbeat_nonces ( $response )
Paramètres:
  • (array) $response The Heartbeat response.
    Requis: Oui
Retourne:
  • (array) The Heartbeat response.
Défini(e) dans:
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;
}