wp_underscore_playlist_templates

Outputs the templates used by playlists.

Description

wp_underscore_playlist_templates(); 

Usage

  1. if ( !function_exists( 'wp_underscore_playlist_templates' ) ) { 
  2. require_once ABSPATH . WPINC . '/media.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_underscore_playlist_templates(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/media.php  
  1. function wp_underscore_playlist_templates() { 
  2. ?> 
  3. <script type="text/html" id="tmpl-wp-playlist-current-item"> 
  4. <# if ( data.image ) { #> 
  5. <img src="{{ data.thumb.src }}" alt="" /> 
  6. <# } #> 
  7. <div class="wp-playlist-caption"> 
  8. <span class="wp-playlist-item-meta wp-playlist-item-title"><?php 
  9. /** translators: playlist item title */ 
  10. printf( _x( '“%s”', 'playlist item title' ), '{{ data.title }}' ); 
  11. ?></span> 
  12. <# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #> 
  13. <# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #> 
  14. </div> 
  15. </script> 
  16. <script type="text/html" id="tmpl-wp-playlist-item"> 
  17. <div class="wp-playlist-item"> 
  18. <a class="wp-playlist-caption" href="{{ data.src }}"> 
  19. {{ data.index ? ( data.index + '. ' ) : '' }} 
  20. <# if ( data.caption ) { #> 
  21. {{ data.caption }} 
  22. <# } else { #> 
  23. <span class="wp-playlist-item-title"><?php 
  24. /** translators: playlist item title */ 
  25. printf( _x( '“%s”', 'playlist item title' ), '{{{ data.title }}}' ); 
  26. ?></span> 
  27. <# if ( data.artists && data.meta.artist ) { #> 
  28. <span class="wp-playlist-item-artist"> — {{ data.meta.artist }}</span> 
  29. <# } #> 
  30. <# } #> 
  31. </a> 
  32. <# if ( data.meta.length_formatted ) { #> 
  33. <div class="wp-playlist-item-length">{{ data.meta.length_formatted }}</div> 
  34. <# } #> 
  35. </div> 
  36. </script> 
  37. <?php