media_submitbox_misc_sections хук-фильтрWP 3.7.0

Filters the audio and video metadata fields to be shown in the publish meta box.

The key for each item in the array should correspond to an attachment metadata key, and the value should be the desired label.

Использование

add_filter( 'media_submitbox_misc_sections', 'wp_kama_media_submitbox_misc_sections_filter', 10, 2 );

/**
 * Function for `media_submitbox_misc_sections` filter-hook.
 * 
 * @param array   $fields An array of the attachment metadata keys and labels.
 * @param WP_Post $post   WP_Post object for the current attachment.
 *
 * @return array
 */
function wp_kama_media_submitbox_misc_sections_filter( $fields, $post ){

	// filter...
	return $fields;
}
$fields(массив)
An array of the attachment metadata keys and labels.
$post(WP_Post)
WP_Post object for the current attachment.

Список изменений

С версии 3.7.0 Введена.
С версии 4.9.0 Added the $post parameter.

Где вызывается хук

attachment_submitbox_metadata()
media_submitbox_misc_sections
wp-admin/includes/media.php 3424
$fields = apply_filters( 'media_submitbox_misc_sections', $fields, $post );

Где используется хук в WordPress

Использование не найдено.