ACF_Ajax::requestpublicACF 5.7.2

request

Callback for ajax action. Sets up properties and calls the get_response() function.

Method of the class: ACF_Ajax{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ACF_Ajax = new ACF_Ajax();
$ACF_Ajax->request();

Changelog

Since 5.7.2 Introduced.

ACF_Ajax::request() code ACF 6.8.8

function request() {

	// Store data for has() and get() functions.
	$this->request = wp_unslash( $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Verified below in verify_request().

	// Verify request and handle error.
	$error = $this->verify_request( $this->request );
	if ( is_wp_error( $error ) ) {
		$this->send( $error );
	}

	// Send response.
	$this->send( $this->get_response( $this->request ) );
}