wp_read_video_metadata filter-hookWP 4.9.0

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 $file_format File format of video, as analyzed by getID3.
 * @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)
File format of video, as analyzed by getID3.
$data(array)
Raw metadata from getID3.

Changelog

Since 4.9.0 Introduced.

Where the hook is called

wp_read_video_metadata()
wp_read_video_metadata
wp-admin/includes/media.php 3633
return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );

Where the hook is used in WordPress

Usage not found.