bp_activity_<amount>_<action_filter>_notification

Filters the activity notification for the string format.

Description

apply_filters( 'bp_activity_<amount>_<action_filter>_notification', (string) $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a, (string) $link, (int) $int_total_items, (int) $activity_id, (int) $user_id ); 

This is a variable filter that is dependent on how many items need notified about. The two possible hooks are bp_activity_single_at_mentions_notification or bp_activity_multiple_at_mentions_notification.

Parameters (5)

0. $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a — Optional. (string) => '' . esc_html( $text ) . ''
The href esc url link title esc attr title esc html text a.
1. $link (string)
The permalink for the interaction.
2. $int_total_items (int) => (int) $total_items
How many items being notified about.
3. $activity_id (int)
ID of the activity item being formatted.
4. $user_id (int)
ID of the user who inited the interaction.

Usage

To run the hook, copy the example below.
  1. $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a = apply_filters( 'bp_activity_{$amount}_{$action_filter}_notification', $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a, $link, $int_total_items, $activity_id, $user_id ); 
  2.  
  3. if ( !empty( $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_activity_<amount>_<action_filter>_notification callback 
  2. function filter_bp_activity_amount_action_filter_notification( $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a, $link, $int_total_items, $activity_id, $user_id ) { 
  3. // make filter magic happen here... 
  4. return $a_href_esc_url_link_title_esc_attr_title_esc_html_text_a
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "bp_activity_{$amount}_{$action_filter}_notification", 'filter_bp_activity_amount_action_filter_notification', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "bp_activity_{$amount}_{$action_filter}_notification", 'filter_bp_activity_amount_action_filter_notification', 10, 5 ); 

Defined (2)

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

/bp-activity/bp-activity-notifications.php  
  1. $return = apply_filters( 'bp_activity_' . $amount . '_' . $action_filter . '_notification', '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $text ) . '</a>', $link, (int) $total_items, $activity_id, $user_id ); 
  1. $return = apply_filters( 'bp_activity_' . $amount . '_' . $action_filter . '_notification', array(