Make WordPress Core

Ticket #25171: 25171.patch

File 25171.patch, 804 bytes (added by desrosj, 10 years ago)

Adds manage_media_misc_sections & manage_audio_misc_sections filters for adding or removing of sections on attachment edit screens.

  • media.php

     
    24522452<?php
    24532453        if ( preg_match( '#^audio|video#', $post->post_mime_type ) ):
    24542454
    2455                 $fields = array(
     2455                $fields = apply_filters( 'manage_media_misc_sections', array(
    24562456                        'mime_type' => __( 'Mime-type:' ),
    24572457                        'year' => __( 'Year:' ),
    24582458                        'genre' => __( 'Genre:' ),
    24592459                        'length_formatted' => __( 'Length:' ),
    2460                 );
     2460                ) );
    24612461
    24622462                foreach ( $fields as $key => $label ):
    24632463                        if ( ! empty( $meta[$key] ) ) : ?>
     
    24812481        <?php
    24822482                endif;
    24832483
    2484                 $audio_fields = array(
     2484                $audio_fields = apply_filters( 'manage_audio_misc_sections', array(
    24852485                        'dataformat' => __( 'Audio Format:' ),
    24862486                        'codec' => __( 'Audio Codec:' )
    2487                 );
     2487                ) );
    24882488
    24892489                foreach ( $audio_fields as $key => $label ):
    24902490                        if ( ! empty( $meta['audio'][$key] ) ) : ?>