Prepares links for the request.
Description
See also
Parameters
- $element_type
-
(awsmug\Torro_Forms\DB_Objects\Elements\Element_Types\Element_Type) (Required) Element type object.
Return
(array) Links for the given element type.
Source
File: src/db-objects/elements/element-types/rest-element-types-controller.php
protected function prepare_links( $element_type ) { $base = sprintf( '%s/%s', $this->namespace, $this->rest_base ); $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $element_type->get_slug() ), ), 'collection' => array( 'href' => rest_url( $base ), ), 'elements' => array( 'href' => rest_url( substr( $base, 0, -6 ) . '?type=' . $element_type->get_slug() ), ), ); return $links; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |