wp_embed_handler_audio

Audio embed handler callback.

Description

(string) wp_embed_handler_audio( (array) $matches, (array) $attr, (string) $url, (array) $rawattr ); 

Returns (string)

The embed HTML.

Parameters (4)

0. $matches (array)
The RegEx matches from the provided regex when calling wp_embed_register_handler().
1. $attr (array)
Embed attributes.
2. $url (string)
The original URL that was matched by the regex.
3. $rawattr (array)
The original unmodified attributes.

Usage

  1. if ( !function_exists( 'wp_embed_handler_audio' ) ) { 
  2. require_once ABSPATH . WPINC . '/embed.php'; 
  3.  
  4. // The RegEx matches from the provided regex when calling wp_embed_register_handler(). 
  5. $matches = array(); 
  6.  
  7. // Embed attributes. 
  8. $attr = array(); 
  9.  
  10. // The original URL that was matched by the regex. 
  11. $url = ''; 
  12.  
  13. // The original unmodified attributes. 
  14. $rawattr = array(); 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = wp_embed_handler_audio($matches, $attr, $url, $rawattr); 
  18.  

Defined (1)

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

/wp-includes/embed.php  
  1. function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) { 
  2. $audio = sprintf( '[audio src="%s" /]', esc_url( $url ) ); 
  3.  
  4. /** 
  5. * Filters the audio embed output. 
  6. * @since 3.6.0 
  7. * @param string $audio Audio embed output. 
  8. * @param array $attr An array of embed attributes. 
  9. * @param string $url The original URL that was matched by the regex. 
  10. * @param array $rawattr The original unmodified attributes. 
  11. */ 
  12. return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );