bp_core_delete_notification

Delete a specific notification by its ID.

Description

(boolean) bp_core_delete_notification( (int) $id ); 

Returns (boolean)

True on success, false on failure.

Parameters (1)

0. $id (int)
ID of notification.

Usage

  1. if ( !function_exists( 'bp_core_delete_notification' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/1.9.php'; 
  3.  
  4. // ID of notification. 
  5. $id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_delete_notification($id); 
  9.  

Defined (1)

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

/bp-core/deprecated/1.9.php  
  1. function bp_core_delete_notification( $id ) { 
  2.  
  3. // Bail if notifications is not active 
  4. if ( ! bp_is_active( 'notifications' ) ) { 
  5. return false; 
  6.  
  7. // Trigger the deprecated function notice 
  8. _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notification()' ); 
  9.  
  10. return BP_Notifications_Notification::delete_by_id( $id );