Changeset 27640 for trunk/src/wp-includes/media.php
- Timestamp:
- 03/20/2014 01:33:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r27625 r27640 1000 1000 1001 1001 /** 1002 * Output and enqueue default scripts and styles for playlists.1002 * Output the templates used by playlists 1003 1003 * 1004 1004 * @since 3.9.0 1005 * 1006 * @param string $type Type of playlist: "audio" or "video." 1007 */ 1008 function wp_playlist_scripts( $type ) { 1009 wp_enqueue_style( 'wp-mediaelement' ); 1010 wp_enqueue_script( 'wp-playlist' ); 1005 */ 1006 function wp_underscore_playlist_templates() { 1011 1007 ?> 1012 <!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ) ?>');</script><![endif]-->1013 1008 <script type="text/html" id="tmpl-wp-playlist-current-item"> 1014 1009 <# if ( data.image ) { #> … … 1046 1041 <?php 1047 1042 } 1043 1044 /** 1045 * Output and enqueue default scripts and styles for playlists. 1046 * 1047 * @since 3.9.0 1048 * 1049 * @param string $type Type of playlist: "audio" or "video." 1050 */ 1051 function wp_playlist_scripts( $type ) { 1052 wp_enqueue_style( 'wp-mediaelement' ); 1053 wp_enqueue_script( 'wp-playlist' ); 1054 ?> 1055 <!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ) ?>');</script><![endif]--> 1056 <?php 1057 wp_underscore_playlist_templates(); 1058 } 1048 1059 add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' ); 1049 1060 … … 1391 1402 $default_types = wp_get_audio_extensions(); 1392 1403 $defaults_atts = array( 1404 'caption' => '', 1393 1405 'src' => '', 1394 1406 'loop' => '', … … 1550 1562 $default_types = wp_get_video_extensions(); 1551 1563 $defaults_atts = array( 1564 'caption' => '', 1552 1565 'src' => '', 1553 1566 'poster' => '', … … 2333 2346 if ( isset( $meta['length_formatted'] ) ) 2334 2347 $response['fileLength'] = $meta['length_formatted']; 2348 2349 $response['meta'] = array(); 2350 $keys = array( 'title', 'artist', 'band', 'album', 'genre', 'year', 'length', 'length_formatted' ); 2351 foreach ( $keys as $key ) { 2352 if ( ! empty( $meta[ $key ] ) ) { 2353 $response['meta'][ $key ] = $meta[ $key ]; 2354 } 2355 } 2356 2357 $id = get_post_thumbnail_id( $attachment->ID ); 2358 if ( ! empty( $id ) ) { 2359 list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'full' ); 2360 $response['image'] = compact( 'src', 'width', 'height' ); 2361 list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' ); 2362 $response['thumb'] = compact( 'src', 'width', 'height' ); 2363 } 2335 2364 } 2336 2365
Note: See TracChangeset
for help on using the changeset viewer.