bp_activity_create_summary_extractor_class

Filter the class name of the media extractor when creating an Activity summary.

Description

apply_filters( 'bp_activity_create_summary_extractor_class', (string) $bp_media_extractor, (string) $content, (array) $activity ); 

Use this filter to change the media extractor used to extract media info for the activity item.

Parameters (3)

0. $bp_media_extractor (string) => 'BP_Media_Extractor'
The bp media extractor.
1. $content (string)
The content of the activity item.
2. $activity (array)
The data passed to bp_activity_add() or the values from an Activity obj.

Usage

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

Defined (1)

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

/bp-activity/bp-activity-functions.php  
  1. $extractor = apply_filters( 'bp_activity_create_summary_extractor_class', 'BP_Media_Extractor', $content, $activity );