Filter hook 'wp_audio_extensions'

in WP Core File wp-includes/media.php at line 3309

View Source

wp_audio_extensions

Filter Hook
Description
Filters the list of supported audio formats.

Hook Information

File Location wp-includes/media.php View on GitHub
Hook Type Filter
Line Number 3309

Hook Parameters

Type Name Description
string[] $extensions An array of supported audio formats. Defaults are 'mp3', 'ogg', 'flac', 'm4a', 'wav'.

Usage Examples

Basic Usage
<?php
// Hook into wp_audio_extensions
add_filter('wp_audio_extensions', 'my_custom_filter', 10, 1);

function my_custom_filter($extensions) {
    // Your custom filtering logic here
    return $extensions;
}

Source Code Context

wp-includes/media.php:3309 - How this hook is used in WordPress core
<?php
3304  	 * @since 3.6.0
3305  	 *
3306  	 * @param string[] $extensions An array of supported audio formats. Defaults are
3307  	 *                            'mp3', 'ogg', 'flac', 'm4a', 'wav'.
3308  	 */
3309  	return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );
3310  }
3311  
3312  /**
3313   * Returns useful keys to use to lookup data from an attachment's stored metadata.
3314   *

PHP Documentation

<?php
/**
	 * Filters the list of supported audio formats.
	 *
	 * @since 3.6.0
	 *
	 * @param string[] $extensions An array of supported audio formats. Defaults are
	 *                            'mp3', 'ogg', 'flac', 'm4a', 'wav'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.