bp_activity_create_summary

Filters the newly-generated summary for the activity item.

Description

apply_filters( 'bp_activity_create_summary', (string) $summary, (string) $content, (array) $activity, (array) $extracted_media ); 

Parameters (4)

0. $summary (string)
Activity summary HTML.
1. $content (string)
Content of the activity item.
2. $activity (array)
The data passed to bp_activity_add() or the values from an Activity obj.
3. $extracted_media (array)
Media item extracted. See for format.

Usage

To run the hook, copy the example below.
  1. $summary = apply_filters( 'bp_activity_create_summary', $summary, $content, $activity, $extracted_media ); 
  2.  
  3. if ( !empty( $summary ) ) { 
  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_create_summary callback 
  2. function filter_bp_activity_create_summary( $summary, $content, $activity, $extracted_media ) { 
  3. // make filter magic happen here... 
  4. return $summary
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_activity_create_summary', 'filter_bp_activity_create_summary', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_activity_create_summary', 'filter_bp_activity_create_summary', 10, 4 ); 

Defined (1)

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

/bp-activity/bp-activity-functions.php  
  1. return apply_filters( 'bp_activity_create_summary', $summary, $content, $activity, $extracted_media );