wp_read_audio_metadata
Filter HookDescription
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.Hook Information
File Location |
wp-admin/includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3764 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$metadata
|
Filtered audio metadata. |
string
|
$file
|
Path to audio file. |
string|null
|
$file_format
|
File format of audio, as analyzed by getID3. Null if unknown. |
array
|
$data
|
Raw metadata from getID3. |
Usage Examples
Basic Usage
<?php
// Hook into wp_read_audio_metadata
add_filter('wp_read_audio_metadata', 'my_custom_filter', 10, 4);
function my_custom_filter($metadata, $file, $file_format, $data) {
// Your custom filtering logic here
return $metadata;
}
Source Code Context
wp-admin/includes/media.php:3764
- How this hook is used in WordPress core
<?php
3759 * @param string $file Path to audio file.
3760 * @param string|null $file_format File format of audio, as analyzed by getID3.
3761 * Null if unknown.
3762 * @param array $data Raw metadata from getID3.
3763 */
3764 return apply_filters( 'wp_read_audio_metadata', $metadata, $file, $file_format, $data );
3765 }
3766
3767 /**
3768 * Parses creation date from media metadata.
3769 *
PHP Documentation
<?php
/**
* 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.
*
* @since 6.1.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-admin/includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.