REST_Submission_Values_Controller::prepare_links( awsmug\Torro_Forms\DB_Objects\Submission_Values\Submission_Value $submission_value )

Prepares links for the request.

Description

Parameters

$submission_value

(awsmug\Torro_Forms\DB_Objects\Submission_Values\Submission_Value) (Required) Submission value object.

Return

(array) Links for the given submission value.

Source

File: src/db-objects/submission-values/rest-submission-values-controller.php

	protected function prepare_links( $submission_value ) {
		$links = parent::prepare_links( $submission_value );

		if ( ! empty( $submission_value->submission_id ) ) {
			$links['submission'] = array(
				'href' => rest_url( trailingslashit( sprintf( '%s/%s', $this->namespace, 'submissions' ) ) . $submission_value->submission_id ),
			);
		}

		return $links;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.