Media Grid, for audio files: show Bitrate in the Edit Attachments modal a la the Edit Post screen.

See #28839.


git-svn-id: https://develop.svn.wordpress.org/trunk@29106 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-07-11 21:55:24 +00:00
parent 16a70197ed
commit 8dddb7334f
2 changed files with 13 additions and 1 deletions

View File

@@ -1463,6 +1463,9 @@ function wp_get_attachment_id3_keys( $attachment, $context = 'display' ) {
$fields['genre'] = __( 'Genre' );
$fields['year'] = __( 'Year' );
$fields['length_formatted'] = _x( 'Length', 'video or audio' );
} elseif ( 'js' === $context ) {
$fields['bitrate'] = __( 'Bitrate' );
$fields['bitrate_mode'] = __( 'Bitrate Mode' );
}
/**
@@ -2716,7 +2719,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
$response['fileLength'] = $meta['length_formatted'];
$response['meta'] = array();
foreach ( wp_get_attachment_id3_keys( $attachment ) as $key => $label ) {
foreach ( wp_get_attachment_id3_keys( $attachment, 'js' ) as $key => $label ) {
if ( ! empty( $meta[ $key ] ) ) {
$response['meta'][ $key ] = $meta[ $key ];
}