bp_activity_get_activity_id

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

Description

(int) bp_activity_get_activity_id( (string) $args = '' ); 

Returns (int)

$activity_id The ID of the activity item found.

Parameters (1)

0. $args — Optional. (string) => ''
See BP_Activity_Activity::get() for description.

Usage

  1. if ( !function_exists( 'bp_activity_get_activity_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-functions.php'; 
  3.  
  4. // See BP_Activity_Activity::get() for description. 
  5. $args = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_activity_get_activity_id($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-activity/bp-activity-functions.php  
  1. function bp_activity_get_activity_id( $args = '' ) { 
  2.  
  3. $r = bp_parse_args( $args, array( 
  4. 'user_id' => false,  
  5. 'component' => false,  
  6. 'type' => false,  
  7. 'item_id' => false,  
  8. 'secondary_item_id' => false,  
  9. 'action' => false,  
  10. 'content' => false,  
  11. 'date_recorded' => false,  
  12. ) ); 
  13.  
  14. /** 
  15. * Filters the activity ID being requested. 
  16. * @since 1.2.0 
  17. * @since 2.5.0 Added the `$r` and `$args` parameters. 
  18. * @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments. 
  19. * @param array $r Parsed function arguments. 
  20. * @param array $args Arguments passed to the function. 
  21. */ 
  22. $r['user_id'],  
  23. $r['component'],  
  24. $r['type'],  
  25. $r['item_id'],  
  26. $r['secondary_item_id'],  
  27. $r['action'],  
  28. $r['content'],  
  29. $r['date_recorded'] 
  30. ), $r, $args );