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




(int) (Required) ID of the topic or reply


(int) if an activity id is verified, false if not


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;


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.