Make WordPress Core


Ignore:
Timestamp:
03/30/2014 07:27:31 PM (10 years ago)
Author:
wonderboymusic
Message:

Metadata for audio and video files:

  • Make attachment metadata for audio files editable by providing a metabox on the Edit Media page
  • Standardize on using the attachment title everywhere
  • Label the Caption and Description fields for audio and video appropriately
  • Make the playlist Underscore templates more straightforward

See #27574.

File:
1 edited

Legend:

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

    r27747 r27862  
    10581058    echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
    10591059}
     1060
     1061/**
     1062 * Display fields for ID3 data
     1063 *
     1064 * @since 3.9.0
     1065 *
     1066 * @param WP_Post $post
     1067 */
     1068function attachment_id3_data_meta_box( $post ) {
     1069    $meta = array();
     1070    if ( ! empty( $post->ID ) ) {
     1071        $meta = wp_get_attachment_metadata( $post->ID );
     1072    }
     1073
     1074    foreach ( wp_get_relevant_id3_keys() as $key => $label ): ?>
     1075    <p>
     1076        <label for="title"><?php echo $label ?></label>
     1077        <input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="widefat" value="<?php
     1078            if ( ! empty( $meta[ $key ] ) ) {
     1079                echo esc_attr( $meta[ $key ] );
     1080            }
     1081        ?>" />
     1082    </p>
     1083    <?php endforeach;
     1084}
Note: See TracChangeset for help on using the changeset viewer.