Changeset 27862 for trunk/src/wp-includes/media.php
- Timestamp:
- 03/30/2014 07:27:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r27813 r27862 1019 1019 <img src="{{{ data.thumb.src }}}"/> 1020 1020 <# } #> 1021 <# if ( data.meta.title ) { #>1022 1021 <div class="wp-playlist-caption"> 1023 <span class="wp-caption-meta wp-caption-title">“{{{ data. meta.title }}}”</span>1024 < span class="wp-caption-meta wp-caption-album">{{{ data.meta.album }}}</span>1025 < span class="wp-caption-meta wp-caption-artist">{{{ data.meta.artist }}}</span>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><# } #> 1026 1025 </div> 1027 <# } else { #>1028 <div class="wp-playlist-caption">{{{ data.caption ? data.caption : data.title }}}</div>1029 <# } #>1030 1026 </script> 1031 1027 <script type="text/html" id="tmpl-wp-playlist-item"> 1032 1028 <div class="wp-playlist-item"> 1033 <# if ( ( data.title || data.meta.title ) && ( ! data.artists || data.meta.artist ) ) { #>1034 1029 <div class="wp-playlist-caption"> 1035 1030 {{{ data.index ? ( data.index + '. ' ) : '' }}} 1036 <span class="wp-caption-title">“{{{ data.title ? data.title : data.meta.title }}}”</span> 1037 <# if ( data.artists ) { #> 1038 <span class="wp-caption-by"><?php _e( 'by' ) ?></span> 1039 <span class="wp-caption-artist">{{{ data.meta.artist }}}</span> 1031 <# if ( data.caption ) { #> 1032 {{{ data.caption }}} 1033 <# } else { #> 1034 <span class="wp-caption-title">“{{{ data.title }}}”</span> 1035 <# if ( data.artists && data.meta.artist ) { #> 1036 <span class="wp-caption-by"><?php _e( 'by' ) ?></span> 1037 <span class="wp-caption-artist">{{{ data.meta.artist }}}</span> 1038 <# } #> 1040 1039 <# } #> 1041 1040 </div> 1042 <# } else { #>1043 <div class="wp-playlist-caption">{{{ data.index ? ( data.index + '.' ) : '' }}} {{{ data.caption ? data.caption : data.title }}}</div>1044 <# } #>1045 1041 <# if ( data.meta.length_formatted ) { #> 1046 1042 <div class="wp-playlist-item-length">{{{ data.meta.length_formatted }}}</div> … … 1208 1204 if ( ! empty( $meta ) ) { 1209 1205 1210 $keys = array( 'title', 'artist', 'band', 'album', 'genre', 'year', 'length', 'length_formatted' ); 1211 foreach ( $keys as $key ) { 1206 foreach ( wp_get_relevant_id3_keys() as $key => $label ) { 1212 1207 if ( ! empty( $meta[ $key ] ) ) { 1213 1208 $track['meta'][ $key ] = $meta[ $key ]; … … 1318 1313 } 1319 1314 1315 /** 1316 * Return useful keys to use to lookup data from an attachment's stored metadata 1317 * 1318 * @since 3.9.0 1319 * 1320 * @return array 1321 */ 1322 function wp_get_relevant_id3_keys() { 1323 $fields = array( 1324 'artist' => __( 'Artist' ), 1325 'album' => __( 'Album' ), 1326 'genre' => __( 'Genre' ), 1327 'year' => __( 'Year' ), 1328 'length_formatted' => __( 'Formatted Length' ) 1329 ); 1330 /** 1331 * Filter the editable list of keys to lookup data from an attachment's metadata 1332 * 1333 * @since 3.9.0 1334 * 1335 * @param array $fields 1336 */ 1337 return apply_filters( 'wp_get_relevant_id3_keys', $fields ); 1338 } 1320 1339 /** 1321 1340 * The Audio shortcode. … … 2313 2332 2314 2333 $response['meta'] = array(); 2315 $keys = array( 'title', 'artist', 'band', 'album', 'genre', 'year', 'length', 'length_formatted' ); 2316 foreach ( $keys as $key ) { 2334 foreach ( wp_get_relevant_id3_keys() as $key => $label ) { 2317 2335 if ( ! empty( $meta[ $key ] ) ) { 2318 2336 $response['meta'][ $key ] = $meta[ $key ];
Note: See TracChangeset
for help on using the changeset viewer.