wp_embed_handler_audio

Filters the audio embed output.

Description

apply_filters( 'wp_embed_handler_audio', (string) $audio, (array) $attr, (string) $url, (array) $rawattr ); 

Parameters (4)

0. $audio (string)
Audio embed output.
1. $attr (array)
An array of embed attributes.
2. $url (string)
The original URL that was matched by the regex.
3. $rawattr (array)
The original unmodified attributes.

Usage

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

Defined (1)

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

/wp-includes/embed.php  
  1. return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );