Changeset 27864
- Timestamp:
- 03/30/2014 09:07:04 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r27862 r27864 141 141 add_action( 'edit_form_after_title', 'edit_form_image_editor' ); 142 142 143 if ( preg_match( '#^audio#', $post->post_mime_type) ) {143 if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) { 144 144 add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core' ); 145 145 } -
trunk/src/wp-admin/includes/media.php
r27862 r27864 2663 2663 <p> 2664 2664 <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong><?php 2665 if ( preg_match( '#^ audio|video#', $post->post_mime_type ) ): ?>: <?php2665 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ): ?>: <?php 2666 2666 _e( "Custom label for item in a playlist. If empty, the file's available data is used." ); 2667 2667 endif ?></label><br /> … … 2689 2689 2690 2690 <label for="content"><strong><?php _e( 'Description' ); ?></strong><?php 2691 if ( preg_match( '#^ audio|video#', $post->post_mime_type ) ): ?>: <?php2691 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ): ?>: <?php 2692 2692 _e( 'Displayed on attachment pages.' ); 2693 2693 endif ?></label> … … 2752 2752 endif; 2753 2753 2754 if ( preg_match( '#^(audio|video) #', $post->post_mime_type ) ):2754 if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ): 2755 2755 2756 2756 /** -
trunk/src/wp-admin/includes/meta-boxes.php
r27862 r27864 1072 1072 } 1073 1073 1074 foreach ( wp_get_relevant_id3_keys( ) as $key => $label ): ?>1074 foreach ( wp_get_relevant_id3_keys( $post ) as $key => $label ): ?> 1075 1075 <p> 1076 1076 <label for="title"><?php echo $label ?></label> -
trunk/src/wp-admin/includes/post.php
r27862 r27864 238 238 } 239 239 240 if ( 'attachment' === $post_data['post_type'] && preg_match( '#^ audio|video#', $post_data['post_mime_type'] ) ) {240 if ( 'attachment' === $post_data['post_type'] && preg_match( '#^(audio|video)/#', $post_data['post_mime_type'] ) ) { 241 241 $id3data = wp_get_attachment_metadata( $post_ID ); 242 242 if ( ! is_array( $id3data ) ) { … … 244 244 } 245 245 246 foreach ( wp_get_relevant_id3_keys( ) as $key => $label ) {246 foreach ( wp_get_relevant_id3_keys( $post ) as $key => $label ) { 247 247 if ( isset( $post_data[ 'id3_' . $key ] ) ) { 248 if ( current_user_can( 'unfiltered_html' ) ) { 249 $id3data[ $key ] = wp_unslash( $post_data[ 'id3_' . $key ] ); 250 } else { 251 $id3data[ $key ] = wp_unslash( wp_kses_post( $post_data[ 'id3_' . $key ] ) ); 252 } 248 $id3data[ $key ] = sanitize_post_field( wp_unslash( $post_data[ 'id3_' . $key ] ) ); 253 249 } 254 250 } -
trunk/src/wp-includes/media.php
r27862 r27864 1017 1017 <script type="text/html" id="tmpl-wp-playlist-current-item"> 1018 1018 <# if ( data.image ) { #> 1019 <img src="{{ { data.thumb.src }}}"/>1019 <img src="{{ data.thumb.src }}"/> 1020 1020 <# } #> 1021 1021 <div class="wp-playlist-caption"> 1022 1022 <span class="wp-caption-meta wp-caption-title">“{{{ data.title }}}”</span> 1023 <# if ( data.meta.album ) { #><span class="wp-caption-meta wp-caption-album">{{ { data.meta.album }}}</span><# } #>1024 <# if ( data.meta.artist ) { #><span class="wp-caption-meta wp-caption-artist">{{ { data.meta.artist }}}</span><# } #>1023 <# if ( data.meta.album ) { #><span class="wp-caption-meta wp-caption-album">{{ data.meta.album }}</span><# } #> 1024 <# if ( data.meta.artist ) { #><span class="wp-caption-meta wp-caption-artist">{{ data.meta.artist }}</span><# } #> 1025 1025 </div> 1026 1026 </script> … … 1028 1028 <div class="wp-playlist-item"> 1029 1029 <div class="wp-playlist-caption"> 1030 {{ { data.index ? ( data.index + '. ' ) : '' }}}1030 {{ data.index ? ( data.index + '. ' ) : '' }} 1031 1031 <# if ( data.caption ) { #> 1032 1032 {{{ data.caption }}} … … 1035 1035 <# if ( data.artists && data.meta.artist ) { #> 1036 1036 <span class="wp-caption-by"><?php _e( 'by' ) ?></span> 1037 <span class="wp-caption-artist">{{ { data.meta.artist }}}</span>1037 <span class="wp-caption-artist">{{ data.meta.artist }}</span> 1038 1038 <# } #> 1039 1039 <# } #> … … 1204 1204 if ( ! empty( $meta ) ) { 1205 1205 1206 foreach ( wp_get_relevant_id3_keys( ) as $key => $label ) {1206 foreach ( wp_get_relevant_id3_keys( $attachment ) as $key => $label ) { 1207 1207 if ( ! empty( $meta[ $key ] ) ) { 1208 1208 $track['meta'][ $key ] = $meta[ $key ]; … … 1318 1318 * @since 3.9.0 1319 1319 * 1320 * @param WP_Post $post The post in question, provided for context. 1320 1321 * @return array 1321 1322 */ 1322 function wp_get_relevant_id3_keys( ) {1323 function wp_get_relevant_id3_keys( $post ) { 1323 1324 $fields = array( 1324 1325 'artist' => __( 'Artist' ), … … 1328 1329 'length_formatted' => __( 'Formatted Length' ) 1329 1330 ); 1331 1330 1332 /** 1331 * Filter the editable list of keys to lookup data from an attachment's metadata 1333 * Filter the editable list of keys to lookup data from an attachment's metadata. 1332 1334 * 1333 1335 * @since 3.9.0 1334 1336 * 1335 * @param array $fields 1337 * @param array $fields Key/value pairs of field keys to labels. 1338 * @param WP_Post $post Post object. 1336 1339 */ 1337 return apply_filters( 'wp_get_relevant_id3_keys', $fields );1340 return apply_filters( 'wp_get_relevant_id3_keys', $fields, $post ); 1338 1341 } 1339 1342 /** … … 2332 2335 2333 2336 $response['meta'] = array(); 2334 foreach ( wp_get_relevant_id3_keys( ) as $key => $label ) {2337 foreach ( wp_get_relevant_id3_keys( $attachment ) as $key => $label ) { 2335 2338 if ( ! empty( $meta[ $key ] ) ) { 2336 2339 $response['meta'][ $key ] = $meta[ $key ];
Note: See TracChangeset
for help on using the changeset viewer.