From 877ffc087fcb0cebf08e299bbffb1549885179bd Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 30 Mar 2014 21:07:04 +0000 Subject: [PATCH] Cleanups for audio/video metadata, see [27862]. see #27574. git-svn-id: https://develop.svn.wordpress.org/trunk@27864 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-advanced.php | 2 +- src/wp-admin/includes/media.php | 6 +++--- src/wp-admin/includes/meta-boxes.php | 2 +- src/wp-admin/includes/post.php | 10 +++------- src/wp-includes/media.php | 25 ++++++++++++++----------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 7f0ea62f6a..b1d0bf57fa 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -140,7 +140,7 @@ if ( 'attachment' == $post_type ) { add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' ); add_action( 'edit_form_after_title', 'edit_form_image_editor' ); - if ( preg_match( '#^audio#', $post->post_mime_type ) ) { + if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) { add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core' ); } } else { diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 47bbfdb509..91d558618a 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -2662,7 +2662,7 @@ function edit_form_image_editor( $post ) {


@@ -2688,7 +2688,7 @@ function edit_form_image_editor( $post ) { ?> post_content, 'attachment_content', $editor_args ); ?> @@ -2751,7 +2751,7 @@ function attachment_submitbox_metadata() { post_mime_type ) ): + if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ): /** * Filter the audio and video metadata fields to be shown in the publish meta box. diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php index f91df90347..f690f8b7e7 100644 --- a/src/wp-admin/includes/meta-boxes.php +++ b/src/wp-admin/includes/meta-boxes.php @@ -1071,7 +1071,7 @@ function attachment_id3_data_meta_box( $post ) { $meta = wp_get_attachment_metadata( $post->ID ); } - foreach ( wp_get_relevant_id3_keys() as $key => $label ): ?> + foreach ( wp_get_relevant_id3_keys( $post ) as $key => $label ): ?>

<# if ( data.image ) { #> - + <# } #>

“{{{ data.title }}}” - <# if ( data.meta.album ) { #>{{{ data.meta.album }}}<# } #> - <# if ( data.meta.artist ) { #>{{{ data.meta.artist }}}<# } #> + <# if ( data.meta.album ) { #>{{ data.meta.album }}<# } #> + <# if ( data.meta.artist ) { #>{{ data.meta.artist }}<# } #>