bp_activity_get_activity_id( array|string $args = '' )

Fetch the activity_id for an existing activity entry in the DB.

Description

See also

Parameters

$args

(array|string) (Optional) See BP_Activity_Activity::get() for description.

Default value: ''

Return

(int) $activity_id The ID of the activity item found.

Source

File: bp-activity/bp-activity-functions.php

function bp_activity_get_activity_id( $args = '' ) {

	$r = bp_parse_args( $args, array(
		'user_id'           => false,
		'component'         => false,
		'type'              => false,
		'item_id'           => false,
		'secondary_item_id' => false,
		'action'            => false,
		'content'           => false,
		'date_recorded'     => false,
	) );

	/**
	 * Filters the activity ID being requested.
	 *
	 * @since BuddyPress 1.2.0
	 * @since BuddyPress 2.5.0 Added the `$r` and `$args` parameters.
	 *
	 * @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments.
	 * @param array                $r     Parsed function arguments.
	 * @param array                $args  Arguments passed to the function.
	 */
	return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id(
		$r['user_id'],
		$r['component'],
		$r['type'],
		$r['item_id'],
		$r['secondary_item_id'],
		$r['action'],
		$r['content'],
		$r['date_recorded']
	), $r, $args );
}

Changelog

Changelog
Version Description
BuddyPress 1.2.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.