钩子文档

media_submitbox_misc_sections

💡 云策文档标注

概述

media_submitbox_misc_sections 是一个 WordPress 过滤器,用于控制在发布元框中显示的音频和视频附件元数据字段。开发者可以通过此过滤器自定义元数据键和标签的数组。

关键要点

  • 过滤器名称:media_submitbox_misc_sections
  • 用途:过滤附件元数据字段,以在发布元框中显示音频和视频的元数据
  • 参数:$fields(元数据键和标签的数组)、$post(当前附件的 WP_Post 对象)
  • 数组键对应附件元数据键,值对应标签
  • 相关函数:attachment_submitbox_metadata() 用于在发布元框中显示不可编辑的附件元数据
  • 版本历史:WordPress 3.7.0 引入,4.9.0 添加 $post 参数

📄 原文内容

Filters the audio and video 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

$fieldsarray
An array of the attachment metadata keys and labels.
$postWP_Post
WP_Post object for the current attachment.

Source

$fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post );

Changelog

Version Description
4.9.0 Added the $post parameter.
3.7.0 Introduced.