mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Allow filtering audio file metadata in wp_read_audio_metadata().
This changeset introduces the `wp_read_audio_metadata` hook which allows to filter metadata extracted from an uploaded audio file. This brings consistency with corresponding filters available for image and video file types: - `wp_read_image_metadata` added in [6313] / #5162. - `wp_read_video_metadata` added in [41746] / #35218. Props luigipulcini, SergeyBiryukov, mukesh27. Fixes #55828. git-svn-id: https://develop.svn.wordpress.org/trunk@53764 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
40768e4ebe
commit
ce00971ca1
@ -3697,7 +3697,22 @@ function wp_read_audio_metadata( $file ) {
|
||||
|
||||
wp_add_id3_tag_data( $metadata, $data );
|
||||
|
||||
return $metadata;
|
||||
$file_format = isset( $metadata['fileformat'] ) ? $metadata['fileformat'] : null;
|
||||
|
||||
/**
|
||||
* 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 $file_format File format of audio, as analyzed by getID3.
|
||||
* @param array $data Raw metadata from getID3.
|
||||
*/
|
||||
return apply_filters( 'wp_read_audio_metadata', $metadata, $file, $file_format, $data );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user