BP_REST_Activity_Comment_Endpoint::get_activity_object( WP_REST_Request $request )
Get activity object.
Description
Parameters
- $request
-
(Required) Full details about the request.
Return
(BP_Activity_Activity|string) An activity object.
Source
File: bp-activity/classes/class-bp-rest-activity-comment-endpoint.php
protected function get_activity_object( $request ) { $activity_id = is_numeric( $request ) ? $request : (int) $request['id']; $display_comments = ( array_key_exists( 'display_comments', $request ) ? $request['display_comments'] : true ); $activity = bp_activity_get_specific( array( 'activity_ids' => array( $activity_id ), 'display_comments' => $display_comments, ) ); if ( is_array( $activity ) && ! empty( $activity['activities'][0] ) ) { return $activity['activities'][0]; } return ''; }
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.