Filter hook 'audio_submitbox_misc_sections'

in WP Core File wp-admin/includes/media.php at line 3489

View Source

audio_submitbox_misc_sections

Filter Hook
Description
Filters the audio attachment 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.

Hook Information

File Location wp-admin/includes/media.php View on GitHub
Hook Type Filter
Line Number 3489

Hook Parameters

Type Name Description
array $fields An array of the attachment metadata keys and labels.
WP_Post $post WP_Post object for the current attachment.

Usage Examples

Basic Usage
<?php
// Hook into audio_submitbox_misc_sections
add_filter('audio_submitbox_misc_sections', 'my_custom_filter', 10, 2);

function my_custom_filter($fields, $post) {
    // Your custom filtering logic here
    return $fields;
}

Source Code Context

wp-admin/includes/media.php:3489 - How this hook is used in WordPress core
<?php
3484  		 * @since 4.9.0 Added the `$post` parameter.
3485  		 *
3486  		 * @param array   $fields An array of the attachment metadata keys and labels.
3487  		 * @param WP_Post $post   WP_Post object for the current attachment.
3488  		 */
3489  		$audio_fields = apply_filters( 'audio_submitbox_misc_sections', $fields, $post );
3490  
3491  		foreach ( $audio_fields as $key => $label ) {
3492  			if ( empty( $meta['audio'][ $key ] ) ) {
3493  				continue;
3494  			}

PHP Documentation

<?php
/**
		 * Filters the audio attachment 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.
		 *
		 * @since 3.7.0
		 * @since 4.9.0 Added the `$post` parameter.
		 *
		 * @param array   $fields An array of the attachment metadata keys and labels.
		 * @param WP_Post $post   WP_Post object for the current attachment.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.