ACF_Rest_Api::initialize │ public │ ACF 1.0

Метод класса: ACF_Rest_Api{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$ACF_Rest_Api = new ACF_Rest_Api();
$ACF_Rest_Api->initialize( $response, $handler, $request );
$response(обязательный)
.
$handler(обязательный)
.
$request(обязательный)
.

Код ACF_Rest_Api::initialize() ACF 6.8.11

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

	// Clear per-request state so a prior dispatch's per-object properties can't leak into enrich_options_endpoint_args().
	$this->per_object_schema = null;
	$this->wp_request        = $request;

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

	$this->register_field();
	$this->maybe_apply_per_object_schema();

	// 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();
	}

	return $response;
}