BP_REST_XProfile_Data_Endpoint::prepare_links( BP_XProfile_ProfileData $field_data )
Prepare links for the request.
Description Description
Parameters Parameters
- $field_data
-
(Required) XProfile field data object.
Return Return
(array)
Source Source
File: bp-xprofile/classes/class-bp-rest-xprofile-data-endpoint.php
protected function prepare_links( $field_data ) { $base = sprintf( '/%s/%s/', $this->namespace, $this->rest_base ); // Entity meta. $links = array( 'self' => array( 'href' => rest_url( $base . $field_data->field_id ), ), 'user' => array( 'href' => rest_url( bp_rest_get_user_url( $field_data->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_XProfile_ProfileData $field_data XProfile field data object. */ return apply_filters( 'bp_rest_xprofile_data_prepare_links', $links, $field_data ); }
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |