W3cubDocs

/WordPress

wp_ajax_rest_nonce()

Handles renewing the REST API nonce via AJAX.

Source

function wp_ajax_rest_nonce() {
	exit( wp_create_nonce( 'wp_rest' ) );
}

Changelog

Version Description
5.3.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_ajax_rest_nonce