bp_media_extractor_shortcodes

Filters shortcodes extracted from text.

Description

apply_filters( 'bp_media_extractor_shortcodes', (array) $data, (string) $richtext, (string) $plaintext, (array) $extra_args ); 

Parameters (4)

0. $data (array)
Extracted shortcodes. See for format.
1. $richtext (string)
Content to parse.
2. $plaintext (string)
Copy of $richtext without any markup.
3. $extra_args (array)
Bespoke data for a particular extractor.

Usage

To run the hook, copy the example below.
  1. $data = apply_filters( 'bp_media_extractor_shortcodes', $data, $richtext, $plaintext, $extra_args ); 
  2.  
  3. if ( !empty( $data ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_media_extractor_shortcodes callback 
  2. function filter_bp_media_extractor_shortcodes( $data, $richtext, $plaintext, $extra_args ) { 
  3. // make filter magic happen here... 
  4. return $data
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_media_extractor_shortcodes', 'filter_bp_media_extractor_shortcodes', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_media_extractor_shortcodes', 'filter_bp_media_extractor_shortcodes', 10, 4 ); 

Defined (1)

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

/bp-core/classes/class-bp-media-extractor.php  
  1. return apply_filters( 'bp_media_extractor_shortcodes', $data, $richtext, $plaintext, $extra_args );