BP_REST_Media_Albums_Endpoint::prepare_item_for_response( BP_Media_Album $album, WP_REST_Request $request )
Prepares activity data for return as an object.
Description
Parameters
- $album
-
(Required) Album data.
- $request
-
(Required) Full details about the request.
Return
(WP_REST_Response)
Source
File: bp-media/classes/class-bp-rest-media-albums-endpoint.php
public function prepare_item_for_response( $album, $request ) { $data = array( 'id' => $album->id, 'user_id' => $album->user_id, 'group_id' => $album->group_id, 'date_created' => $album->date_created, 'title' => $album->title, 'privacy' => $album->privacy, 'media' => $album->media, 'user_email' => $album->user_email, 'user_nicename' => $album->user_nicename, 'user_login' => $album->user_login, 'display_name' => $album->display_name, ); $response = rest_ensure_response( $data ); /** * Filter an activity value returned from the API. * * @param WP_REST_Response $response The response data. * @param WP_REST_Request $request Request used to generate the response. * @param BP_Media $media The Media object. * * @since 0.1.0 */ return apply_filters( 'bp_rest_media_album_prepare_value', $response, $request, $album ); }
Changelog
Version | Description |
---|---|
0.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.