REST_Element_Types_Controller::get_items( WP_REST_Request $request )

Retrieves a collection of element types.

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_items( $request ) {
		$data = array();

		foreach ( $this->manager->types()->get_all() as $obj ) {
			$type = $this->prepare_item_for_response( $obj, $request );

			$data[] = $this->prepare_response_for_collection( $type );
		}

		return rest_ensure_response( $data );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.