bp_core_delete_all_notifications_by_type

Delete all notifications for by type.

Description

(boolean) bp_core_delete_all_notifications_by_type( (int) $item_id, (string) $component_name, (constant) $component_action = false, (bool) $secondary_item_id = false ); 

Returns (boolean)

True on success, false on failure.

Parameters (4)

0. $item_id (int)
The item id.
1. $component_name (string)
The component name.
2. $component_action — Optional. (constant) => false
The component action.
3. $secondary_item_id — Optional. (bool) => false
The secondary item id.

Usage

  1. if ( !function_exists( 'bp_core_delete_all_notifications_by_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/deprecated/1.9.php'; 
  3.  
  4. // The item id. 
  5. $item_id = -1; 
  6.  
  7. // The component name. 
  8. $component_name = ''; 
  9.  
  10. // The component action. 
  11. $component_action = false; 
  12.  
  13. // The secondary item id. 
  14. $secondary_item_id = false; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bp_core_delete_all_notifications_by_type($item_id, $component_name, $component_action, $secondary_item_id); 
  18.  

Defined (1)

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

/bp-core/deprecated/1.9.php  
  1. function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) { 
  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_all_notifications_by_type()' ); 
  9.  
  10. bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id );