钩子文档

wp_read_video_metadata

💡 云策文档标注

概述

wp_read_video_metadata 是一个 WordPress 过滤器,用于修改从视频文件中提取的元数据数组。它允许开发者基于原始数据调整或扩展元数据内容。

关键要点

  • 这是一个过滤器钩子,用于过滤视频元数据数组。
  • 参数包括过滤后的元数据、视频文件路径、文件格式和原始 getID3 数据。
  • 在 WordPress 核心中,通常存储的是过滤后的数据,但可以从原始数据中解析更完整的信息。
  • 首次引入于 WordPress 4.9.0 版本。

代码示例

return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );

注意事项

文件格式参数可能为 null,表示未知格式;原始数据参数提供来自 getID3 的完整元数据,可用于进一步处理。


📄 原文内容

Filters the array of metadata retrieved from a video.

Description

In core, usually this selection is what is stored.
More complete data can be parsed from the $data parameter.

Parameters

$metadataarray
Filtered video metadata.
$filestring
Path to video file.
$file_formatstring|null
File format of video, as analyzed by getID3.
Null if unknown.
$dataarray
Raw metadata from getID3.

Source

return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );

Changelog

Version Description
4.9.0 Introduced.