BP_REST_Activity_Endpoint::get_activity_favorite_count( int $activity_id )
Get favorite count for activity.
Description
Parameters
- $activity_id
-
(Required) The activity id.
Return
(int|mixed)
Source
File: bp-activity/classes/class-bp-rest-activity-endpoint.php
public function get_activity_favorite_count( $activity_id ) { if ( empty( $activity_id ) ) { return; } $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count', true ); return ( ! empty( $fav_count ) ? $fav_count : 0 ); }
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.