bp_activity_get_activity_id( array|string $args = '' )
Fetch the activity_id for an existing activity entry in the DB.
Description Description
See also See also
- BP_Activity_Activity::get(): For more information on accepted arguments.
Parameters Parameters
- $args
-
(Optional) See BP_Activity_Activity::get() for description.
Default value: ''
Return Return
(int) $activity_id The ID of the activity item found.
Source 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 1.2.0
* @since 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 |
|---|---|
| 1.2.0 | Introduced. |