Skip to main content

GF_REST_Forms_Controller

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:7

Details​

Properties​

PropertyTypeDescription
$rest_basestring

Methods​

MethodDescription
register_routes()Register the routes for the objects of the controller.
get_items()Get a collection of items.
get_item()Get one item from the collection.
create_item()Create one item from the collection.
update_item()Update one item from the collection
delete_item()Delete one item from the collection
get_items_permissions_check()Check if a given request has access to get items
get_item_permissions_check()Check if a given request has access to get a specific item
create_item_permissions_check()Check if a given request has access to create items
update_item_permissions_check()Check if a given request has access to update a specific item.
delete_item_permissions_check()Check if a given request has access to delete a specific item.
prepare_item_for_response()Prepare the item for the REST response
get_collection_params()Get the query params for collections

Method Reference​

register_routes()​

public function register_routes()

Register the routes for the objects of the controller.

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:21

get_items()​

public function get_items( $request )

Get a collection of items.

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:86

get_item()​

public function get_item( $request )

Get one item from the collection.

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:145

create_item()​

public function create_item( $request )

Create one item from the collection.

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:165

update_item()​

public function update_item( $request )

Update one item from the collection

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:201

delete_item()​

public function delete_item( $request )

Delete one item from the collection

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:232

get_items_permissions_check()​

public function get_items_permissions_check( $request )

Check if a given request has access to get items

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:280

get_item_permissions_check()​

public function get_item_permissions_check( $request )

Check if a given request has access to get a specific item

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:302

create_item_permissions_check()​

public function create_item_permissions_check( $request )

Check if a given request has access to create items

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:324

update_item_permissions_check()​

public function update_item_permissions_check( $request )

Check if a given request has access to update a specific item.

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:346

delete_item_permissions_check()​

public function delete_item_permissions_check( $request )

Check if a given request has access to delete a specific item.

Parameters​

NameTypeDefaultDescription
$requestWP_REST_RequestFull data about the request.

Returns​

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:368

prepare_item_for_response()​

public function prepare_item_for_response( $item, $request )

Prepare the item for the REST response

Parameters​

NameTypeDefaultDescription
$itemmixedWordPress representation of the item.
$requestWP_REST_RequestRequest object.

Returns​

  • mixed

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:421

get_collection_params()​

public function get_collection_params()

Get the query params for collections

Returns​

  • array

Since: 2.4-beta-1

Source: includes/webapi/v2/includes/controllers/class-controller-forms.php:434