wp_audio_shortcode
Filter HookDescription
Filters the audio shortcode output.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3551 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$html
|
Audio shortcode HTML output. |
array
|
$atts
|
Array of audio shortcode attributes. |
string
|
$audio
|
Audio file. |
int
|
$post_id
|
Post ID. |
string
|
$library
|
Media library used for the audio shortcode. |
Usage Examples
Basic Usage
<?php
// Hook into wp_audio_shortcode
add_filter('wp_audio_shortcode', 'my_custom_filter', 10, 5);
function my_custom_filter($html, $atts, $audio, $post_id, $library) {
// Your custom filtering logic here
return $html;
}
Source Code Context
wp-includes/media.php:3551
- How this hook is used in WordPress core
<?php
3546 * @param array $atts Array of audio shortcode attributes.
3547 * @param string $audio Audio file.
3548 * @param int $post_id Post ID.
3549 * @param string $library Media library used for the audio shortcode.
3550 */
3551 return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
3552 }
3553 add_shortcode( 'audio', 'wp_audio_shortcode' );
3554
3555 /**
3556 * Returns a filtered list of supported video formats.
PHP Documentation
<?php
/**
* Filters the audio shortcode output.
*
* @since 3.6.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 5
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.