acf_verify_ajax()ACF 5.2.3

acf_verify_ajax

This function will return true if the current AJAX request is valid It's action will also allow WPML to set the lang and avoid AJAX get_posts issues

Хуки из функции

Возвращает

(true|false).

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

acf_verify_ajax();

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

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

Код acf_verify_ajax() ACF 6.0.4

function acf_verify_ajax() {

	// bail early if not acf nonce
	if ( empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( $_REQUEST['nonce'] ), 'acf_nonce' ) ) {
		return false;
	}

	// action for 3rd party customization
	do_action( 'acf/verify_ajax' );

	// return
	return true;
}