bp_activity_create_summary_extractor_result

Filter the results of the media extractor when creating an Activity summary.

Description

apply_filters( 'bp_activity_create_summary_extractor_result', (array) $extracted_media, (string) $content, (array) $activity, (array) $media, (string) $use_media_type, (string) $image_source ); 

Parameters (6)

0. $extracted_media (array)
Extracted media item. See for format.
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. $media (array)
All results from the media extraction. See for format.
4. $use_media_type (string)
The kind of media item that was preferentially extracted.
5. $image_source (string)
If $use_media_type was images,, the preferential source of the image. Otherwise empty.

Usage

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

Defined (1)

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

/bp-activity/bp-activity-functions.php  
  1. $extracted_media = apply_filters(