ACF_Rest_Api::initializepublicACF 1.0

Method of the class: ACF_Rest_Api{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ACF_Rest_Api = new ACF_Rest_Api();
$ACF_Rest_Api->initialize( $response, $handler, $request );
$response(required)
.
$handler(required)
.
$request(required)
.

ACF_Rest_Api::initialize() code ACF 6.0.4

public function initialize( $response, $handler, $request ) {
	if ( ! acf_get_setting( 'rest_api_enabled' ) ) {
		return;
	}

	// Parse request and set the object for local access.
	$this->request = new ACF_Rest_Request();
	$this->request->parse_request( $request );

	// Register the 'acf' REST property.
	$this->register_field();

	// If embed links are enabled in ACF's global settings, init the handler and set for local access.
	if ( acf_get_setting( 'rest_api_embed_links' ) ) {
		$this->embed_links = new ACF_Rest_Embed_Links();
		$this->embed_links->initialize();
	}
}