bp_activity_delete_by_content

Delete an activity item by its content.

Description

bp_activity_delete_by_content( (int) $user_id, (string) $content, (string) $component, (string) $type ); 

You should use bp_activity_delete() instead.

Parameters (4)

0. $user_id (int)
The user id.
1. $content (string)
The activity id.
2. $component (string)
The activity component.
3. $type (string)
The activity type.

Usage

  1. if ( !function_exists( 'bp_activity_delete_by_content' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-functions.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // The activity id. 
  8. $content = ''; 
  9.  
  10. // The activity component. 
  11. $component = ''; 
  12.  
  13. // The activity type. 
  14. $type = ''; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bp_activity_delete_by_content($user_id, $content, $component, $type); 
  18.  

Defined (1)

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

/bp-activity/bp-activity-functions.php  
  1. function bp_activity_delete_by_content( $user_id, $content, $component, $type ) { 
  2. return bp_activity_delete( array( 
  3. 'user_id' => $user_id,  
  4. 'content' => $content,  
  5. 'component' => $component,  
  6. 'type' => $type 
  7. ) );