bp_xprofile_<action>_notification

Allows plugins to filter extended profile-related custom notifications.

Description

apply_filters( 'bp_xprofile_<action>_notification', (null) $null, (int) $item_id, (int) $secondary_item_id, (number) $total_items, (string) $format ); 

Notifications must have a component_name of xprofile to be routed to this function.

Parameters (5)

0. $null (null) => null
Null value.
1. $item_id (int)
The primary item ID.
2. $secondary_item_id (int)
The secondary item id.
3. $total_items (number)
The total number of messaging-related notifications waiting for the user.
4. $format (string)
'string' for BuddyBar-compatible notifications; array for WP Toolbar.

Usage

To run the hook, copy the example below.
  1. $null = apply_filters( 'bp_xprofile_{$action}_notification', $null, $item_id, $secondary_item_id, $total_items, $format ); 
  2.  
  3. if ( !empty( $null ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_xprofile_<action>_notification callback 
  2. function filter_bp_xprofile_action_notification( $null, $item_id, $secondary_item_id, $total_items, $format ) { 
  3. // make filter magic happen here... 
  4. return $null
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "bp_xprofile_{$action}_notification", 'filter_bp_xprofile_action_notification', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "bp_xprofile_{$action}_notification", 'filter_bp_xprofile_action_notification', 10, 5 ); 

Defined (1)

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

/bp-xprofile/bp-xprofile-notifications.php  
  1. $custom_action_notification = apply_filters( 'bp_xprofile_' . $action . '_notification', null, $item_id, $secondary_item_id, $total_items, $format );