This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
BBP_BuddyPress_Activity::get_activity_id( int $post_id )
Check for an existing activity stream entry for a given post_id
Description
Parameters
- $post_id
-
(Required) ID of the topic or reply
Return
(int) if an activity id is verified, false if not
Source
File: bp-forums/activity.php
private static function get_activity_id( $post_id = 0 ) { // Try to get the activity ID of the post $activity_id = (int) get_post_meta( $post_id, '_bbp_activity_id', true ); // Bail if no activity ID is in post meta if ( empty( $activity_id ) ) return null; // Get the activity stream item, bail if it doesn't exist $existing = new BP_Activity_Activity( $activity_id ); if ( empty( $existing->component ) ) { return null; } // Return the activity ID since we've verified the connection return $activity_id; }
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.