WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2013 04:18:26 PM (7 years ago)
Author:
helen
Message:

Add media_submitbox_misc_sections and audio_submitbox_misc_sections filters to allow removing or adding of attachment submitbox sections containing attachment metadata. props desroj, DrewAPicture. fixes #25171.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r25277 r25296  
    24542454    if ( preg_match( '#^audio|video#', $post->post_mime_type ) ):
    24552455
    2456         $fields = array(
     2456        /**
     2457         * Audio and video metadata fields to be shown in the publish meta box.
     2458         *
     2459         * The key for each item in the array should correspond to an attachment
     2460         * metadata key, and the value should be the desired label.
     2461         *
     2462         * @since  3.7.0
     2463         *
     2464         * @param array $fields {
     2465         *     An array of the attachment metadata keys and labels.
     2466         *
     2467         *     @type string 'mime_type' Label to be shown before the field mime_type.
     2468         *     @type string 'year' Label to be shown before the field year.
     2469         *     @type string 'genre' Label to be shown before the field genre.
     2470         *     @type string 'length_formatted' Label to be shown before the field length_formatted.
     2471         * }
     2472         */
     2473        $fields = apply_filters( 'media_submitbox_misc_sections', array(
    24572474            'mime_type' => __( 'Mime-type:' ),
    24582475            'year' => __( 'Year:' ),
    24592476            'genre' => __( 'Genre:' ),
    24602477            'length_formatted' => __( 'Length:' ),
    2461         );
     2478        ) );
    24622479
    24632480        foreach ( $fields as $key => $label ):
     
    24832500        endif;
    24842501
    2485         $audio_fields = array(
     2502        /**
     2503         * Audio attachment metadata fields to be shown in the publish meta box.
     2504         *
     2505         * The key for each item in the array should correspond to an attachment
     2506         * metadata key, and the value should be the desired label.
     2507         *
     2508         * @since  3.7.0
     2509         *
     2510         * @param array $fields {
     2511         *     An array of the attachment metadata keys and labels.
     2512         *
     2513         *     @type string 'dataformat' Label to be shown before the field dataformat.
     2514         *     @type string 'codec' Label to be shown before the field codec.
     2515         * }
     2516         */
     2517        $audio_fields = apply_filters( 'audio_submitbox_misc_sections', array(
    24862518            'dataformat' => __( 'Audio Format:' ),
    24872519            'codec' => __( 'Audio Codec:' )
    2488         );
     2520        ) );
    24892521
    24902522        foreach ( $audio_fields as $key => $label ):
Note: See TracChangeset for help on using the changeset viewer.