wp_audio_shortcode
Filters the audio shortcode output.
Usage
add_filter( 'wp_audio_shortcode', 'wp_kama_audio_shortcode_filter', 10, 5 );
/**
* Function for `wp_audio_shortcode` filter-hook.
*
* @param string $html Audio shortcode HTML output.
* @param array $atts Array of audio shortcode attributes.
* @param string $audio Audio file.
* @param int $post_id Post ID.
* @param string $library Media library used for the audio shortcode.
*
* @return string
*/
function wp_kama_audio_shortcode_filter( $html, $atts, $audio, $post_id, $library ){
// filter...
return $html;
}
- $html(string)
- Audio shortcode HTML output.
- $atts(array)
- Array of audio shortcode attributes.
- $audio(string)
- Audio file.
- $post_id(int)
- Post ID.
- $library(string)
- Media library used for the audio shortcode.
Changelog
| Since 3.6.0 | Introduced. |
Where the hook is called
wp-includes/media.php 3568
return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );