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