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.



git-svn-id: https://develop.svn.wordpress.org/trunk@27862 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-03-30 19:27:31 +00:00
parent a9d54abfed
commit 149f36ed35
5 changed files with 93 additions and 23 deletions
+25
View File
@@ -1057,3 +1057,28 @@ function post_thumbnail_meta_box( $post ) {
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
}
/**
* Display fields for ID3 data
*
* @since 3.9.0
*
* @param WP_Post $post
*/
function attachment_id3_data_meta_box( $post ) {
$meta = array();
if ( ! empty( $post->ID ) ) {
$meta = wp_get_attachment_metadata( $post->ID );
}
foreach ( wp_get_relevant_id3_keys() as $key => $label ): ?>
<p>
<label for="title"><?php echo $label ?></label>
<input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="widefat" value="<?php
if ( ! empty( $meta[ $key ] ) ) {
echo esc_attr( $meta[ $key ] );
}
?>" />
</p>
<?php endforeach;
}