BP_REST_Activity_Endpoint::bp_rest_activitiy_edit_data( int $activity_id )

Collect the activity information.

Description

Parameters

$activity_id

(Required) Activity ID.

Return

(array)

Source

File: bp-activity/classes/class-bp-rest-activity-endpoint.php

	public function bp_rest_activitiy_edit_data( $activity_id = 0 ) {
		if ( empty( $activity_id ) ) {
			return array();
		}

		if ( ! function_exists( 'bp_activity_get_edit_data' ) ) {
			return array();
		}

		$edit_activity_data = bp_activity_get_edit_data( $activity_id );

		if ( ! empty( $edit_activity_data ) ) {
			// Removed unwanted data.
			$unset_keys = array( 'id', 'content', 'item_id', 'object', 'privacy', 'media', 'gif', 'document' );
			foreach ( $unset_keys as $key ) {
				if ( array_key_exists( $key, $edit_activity_data ) ) {
					unset( $edit_activity_data[ $key ] );
				}
			}
		}

		return (array) $edit_activity_data;
	}

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.