wp_read_audio_metadata
Filters the array of metadata retrieved from an audio file.
In core, usually this selection is what is stored. More complete data can be parsed from the $data parameter.
Usage
add_filter( 'wp_read_audio_metadata', 'wp_kama_read_audio_metadata_filter', 10, 4 ); /** * Function for `wp_read_audio_metadata` filter-hook. * * @param array $metadata Filtered audio metadata. * @param string $file Path to audio file. * @param string|null $file_format File format of audio, as analyzed by getID3. Null if unknown. * @param array $data Raw metadata from getID3. * * @return array */ function wp_kama_read_audio_metadata_filter( $metadata, $file, $file_format, $data ){ // filter... return $metadata; }
- $metadata(array)
- Filtered audio metadata.
- $file(string)
- Path to audio file.
- $file_format(string|null)
- File format of audio, as analyzed by getID3. Null if unknown.
- $data(array)
- Raw metadata from getID3.
Changelog
Since 6.1.0 | Introduced. |
Where the hook is called
wp_read_audio_metadata
wp-admin/includes/media.php 3760
return apply_filters( 'wp_read_audio_metadata', $metadata, $file, $file_format, $data );