REST_Element_Types_Controller::get_item( WP_REST_Request $request )

Retrieves a specific element type.

Description

Parameters

$request

(WP_REST_Request) (Required) Full details about the request.

Return

(WP_Error|awsmug\Torro_Forms\DB_Objects\Elements\Element_Types\WP_REST_Response) Response object on success, or WP_Error object on failure.

Source

File: src/db-objects/elements/element-types/rest-element-types-controller.php

	public function get_item( $request ) {
		$obj = $this->manager->types()->get( $request['slug'] );

		$data = $this->prepare_item_for_response( $obj, $request );

		return rest_ensure_response( $data );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.