audio_submitbox_misc_sections
云策文档标注
概述
audio_submitbox_misc_sections 是一个 WordPress 过滤器,用于自定义音频附件在发布元框中显示的元数据字段。它允许开发者修改字段的键和标签,以适配特定需求。
关键要点
- 这是一个过滤器钩子,用于过滤音频附件的元数据字段,在发布元框中展示。
- 参数包括一个数组 $fields(包含元数据键和标签)和一个 WP_Post 对象 $post(当前附件)。
- 从 WordPress 4.9.0 版本开始添加了 $post 参数,最初在 3.7.0 版本引入。
代码示例
$audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );注意事项
- 数组中的每个键应对应附件元数据键,值为所需标签。
- 此过滤器与 attachment_submitbox_metadata() 函数相关,用于在发布元框中显示不可编辑的附件元数据。
原文内容
Filters the audio attachment metadata fields to be shown in the publish meta box.
Description
The key for each item in the array should correspond to an attachment metadata key, and the value should be the desired label.
Parameters
Source
$audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );