BP_REST_Group_Membership_Request_Endpoint::prepare_links( BP_Invitation $invite )

Prepare links for the request.


Parameters Parameters

$invite

(BP_Invitation) (Required) Invite object.


Top ↑

Return Return

(array) Links for the given plugin.


Source Source

File: bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php

	protected function prepare_links( $invite ) {
		$base = sprintf( '/%s/%s/', $this->namespace, $this->rest_base );
		$url  = $base . $invite->id;

		// Entity meta.
		$links = array(
			'self'       => array(
				'href' => rest_url( $url ),
			),
			'collection' => array(
				'href' => rest_url( $base ),
			),
			'user'       => array(
				'href'       => rest_url( bp_rest_get_user_url( $invite->user_id ) ),
				'embeddable' => true,
			),
		);

		/**
		 * Filter links prepared for the REST response.
		 *
		 * @since 5.0.0
		 *
		 * @param array         $links  The prepared links of the REST response.
		 * @param BP_Invitation $invite Invite object.
		 */
		return apply_filters( 'bp_rest_group_membership_requests_prepare_links', $links, $invite );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.