wp_audio_shortcode_override
Filter HookDescription
Filters the default audio shortcode output. If the filtered output isn't empty, it will be used instead of generating the default audio template.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3388 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$html
|
Empty variable to be replaced with shortcode markup. |
array
|
$attr
|
Attributes of the shortcode. See {@see wp_audio_shortcode()}. |
string
|
$content
|
Shortcode content. |
int
|
$instance
|
Unique numeric ID of this audio shortcode instance. |
Usage Examples
Basic Usage
<?php
// Hook into wp_audio_shortcode_override
add_filter('wp_audio_shortcode_override', 'my_custom_filter', 10, 4);
function my_custom_filter($html, $attr, $content, $instance) {
// Your custom filtering logic here
return $html;
}
Source Code Context
wp-includes/media.php:3388
- How this hook is used in WordPress core
<?php
3383 * @param string $html Empty variable to be replaced with shortcode markup.
3384 * @param array $attr Attributes of the shortcode. See {@see wp_audio_shortcode()}.
3385 * @param string $content Shortcode content.
3386 * @param int $instance Unique numeric ID of this audio shortcode instance.
3387 */
3388 $override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instance );
3389
3390 if ( '' !== $override ) {
3391 return $override;
3392 }
3393
PHP Documentation
<?php
/**
* Filters the default audio shortcode output.
*
* If the filtered output isn't empty, it will be used instead of generating the default audio template.
*
* @since 3.6.0
*
* @param string $html Empty variable to be replaced with shortcode markup.
* @param array $attr Attributes of the shortcode. See {@see wp_audio_shortcode()}.
* @param string $content Shortcode content.
* @param int $instance Unique numeric ID of this audio shortcode instance.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.