bp_activity_at_mention_delete_notification

Delete at-mention notifications when the corresponding activity item is deleted.

Description

bp_activity_at_mention_delete_notification( (array) $activity_ids_deleted = array() ); 

Parameters (1)

0. $activity_ids_deleted — Optional. (array) => array()
IDs of deleted activity items.

Usage

  1. if ( !function_exists( 'bp_activity_at_mention_delete_notification' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-notifications.php'; 
  3.  
  4. // IDs of deleted activity items. 
  5. $activity_ids_deleted = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_activity_at_mention_delete_notification($activity_ids_deleted); 
  9.  

Defined (1)

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

/bp-activity/bp-activity-notifications.php  
  1. function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) { 
  2. // Let's delete all without checking if content contains any mentions 
  3. // to avoid a query to get the activity. 
  4. if ( ! empty( $activity_ids_deleted ) ) { 
  5. foreach ( $activity_ids_deleted as $activity_id ) { 
  6. bp_notifications_delete_all_notifications_by_type( $activity_id,buddypress)->activity->id );