mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user