BP_REST_Group_Membership_Request_Endpoint::prepare_links( BP_Invitation $invite )
Prepare links for the request.
Description Description
Parameters Parameters
- $invite
-
(Required) Invite object.
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 ); }
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |