wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_refresh_heartbeat_nonces › WordPress Function

Od5.0.0
Przestarzałyn/a
wp_refresh_heartbeat_nonces ( $response )
Parametry:
  • (array) $response The Heartbeat response.
    Wymagane: Tak
Powrót:
  • (array) The Heartbeat response.
Zdefiniowane na:
Codex:

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



Źródło

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