wp_print_media_templates

Prints the templates used in the media manager.

Description

wp_print_media_templates(); 

Usage

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

Defined (1)

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

/wp-includes/media-template.php  
  1. function wp_print_media_templates() { 
  2. global $is_IE; 
  3. $class = 'media-modal wp-core-ui'; 
  4. if ( $is_IE && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false ) 
  5. $class .= ' ie7'; 
  6. ?> 
  7. <!--[if lte IE 8]> 
  8. <style> 
  9. .attachment:focus { 
  10. outline: #1e8cbe solid; 
  11. .selected.attachment { 
  12. outline: #1e8cbe solid; 
  13. </style> 
  14. <![endif]--> 
  15. <script type="text/html" id="tmpl-media-frame"> 
  16. <div class="media-frame-menu"></div> 
  17. <div class="media-frame-title"></div> 
  18. <div class="media-frame-router"></div> 
  19. <div class="media-frame-content"></div> 
  20. <div class="media-frame-toolbar"></div> 
  21. <div class="media-frame-uploader"></div> 
  22. </script> 
  23.  
  24. <script type="text/html" id="tmpl-media-modal"> 
  25. <div class="<?php echo $class; ?>"> 
  26. <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close media panel' ); ?></span></span></button> 
  27. <div class="media-modal-content"></div> 
  28. </div> 
  29. <div class="media-modal-backdrop"></div> 
  30. </script> 
  31.  
  32. <script type="text/html" id="tmpl-uploader-window"> 
  33. <div class="uploader-window-content"> 
  34. <h1><?php _e( 'Drop files to upload' ); ?></h1> 
  35. </div> 
  36. </script> 
  37.  
  38. <script type="text/html" id="tmpl-uploader-editor"> 
  39. <div class="uploader-editor-content"> 
  40. <div class="uploader-editor-title"><?php _e( 'Drop files to upload' ); ?></div> 
  41. </div> 
  42. </script> 
  43.  
  44. <script type="text/html" id="tmpl-uploader-inline"> 
  45. <# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #> 
  46. <# if ( data.canClose ) { #> 
  47. <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close uploader' ); ?></span></button> 
  48. <# } #> 
  49. <div class="uploader-inline-content {{ messageClass }}"> 
  50. <# if ( data.message ) { #> 
  51. <h2 class="upload-message">{{ data.message }}</h2> 
  52. <# } #> 
  53. <?php if ( ! _device_can_upload() ) : ?> 
  54. <h2 class="upload-instructions"><?php printf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ); ?></h2> 
  55. <?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?> 
  56. <h2 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h2> 
  57. <?php 
  58. /** This action is documented in wp-admin/includes/media.php */ 
  59.  
  60. <?php else : ?> 
  61. <div class="upload-ui"> 
  62. <h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files anywhere to upload' ); ?></h2> 
  63. <p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p> 
  64. <button type="button" class="browser button button-hero"><?php _e( 'Select Files' ); ?></button> 
  65. </div> 
  66.  
  67. <div class="upload-inline-status"></div> 
  68.  
  69. <div class="post-upload-ui"> 
  70. <?php 
  71. /** This action is documented in wp-admin/includes/media.php */ 
  72. /** This action is documented in wp-admin/includes/media.php */ 
  73.  
  74. /** This action is documented in wp-admin/includes/media.php */ 
  75. } else { 
  76. /** This action is documented in wp-admin/includes/media.php */ 
  77.  
  78. $max_upload_size = wp_max_upload_size(); 
  79. if ( ! $max_upload_size ) { 
  80. $max_upload_size = 0; 
  81. ?> 
  82.  
  83. <p class="max-upload-size"><?php 
  84. printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); 
  85. ?></p> 
  86.  
  87. <# if ( data.suggestedWidth && data.suggestedHeight ) { #> 
  88. <p class="suggested-dimensions"> 
  89. <?php _e( 'Suggested image dimensions:' ); ?> {{data.suggestedWidth}} × {{data.suggestedHeight}} 
  90. </p> 
  91. <# } #> 
  92.  
  93. <?php 
  94. /** This action is documented in wp-admin/includes/media.php */ 
  95. </div> 
  96. <?php endif; ?> 
  97. </div> 
  98. </script> 
  99.  
  100. <script type="text/html" id="tmpl-media-library-view-switcher"> 
  101. <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?>" class="view-list"> 
  102. <span class="screen-reader-text"><?php _e( 'List View' ); ?></span> 
  103. </a> 
  104. <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ) ?>" class="view-grid current"> 
  105. <span class="screen-reader-text"><?php _e( 'Grid View' ); ?></span> 
  106. </a> 
  107. </script> 
  108.  
  109. <script type="text/html" id="tmpl-uploader-status"> 
  110. <h2><?php _e( 'Uploading' ); ?></h2> 
  111. <button type="button" class="button-link upload-dismiss-errors"><span class="screen-reader-text"><?php _e( 'Dismiss Errors' ); ?></span></button> 
  112.  
  113. <div class="media-progress-bar"><div></div></div> 
  114. <div class="upload-details"> 
  115. <span class="upload-count"> 
  116. <span class="upload-index"></span> / <span class="upload-total"></span> 
  117. </span> 
  118. <span class="upload-detail-separator">–</span> 
  119. <span class="upload-filename"></span> 
  120. </div> 
  121. <div class="upload-errors"></div> 
  122. </script> 
  123.  
  124. <script type="text/html" id="tmpl-uploader-status-error"> 
  125. <span class="upload-error-filename">{{{ data.filename }}}</span> 
  126. <span class="upload-error-message">{{ data.message }}</span> 
  127. </script> 
  128.  
  129. <script type="text/html" id="tmpl-edit-attachment-frame"> 
  130. <div class="edit-media-header"> 
  131. <button class="left dashicons <# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button> 
  132. <button class="right dashicons <# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button> 
  133. </div> 
  134. <div class="media-frame-title"></div> 
  135. <div class="media-frame-content"></div> 
  136. </script> 
  137.  
  138. <script type="text/html" id="tmpl-attachment-details-two-column"> 
  139. <div class="attachment-media-view {{ data.orientation }}"> 
  140. <div class="thumbnail thumbnail-{{ data.type }}"> 
  141. <# if ( data.uploading ) { #> 
  142. <div class="media-progress-bar"><div></div></div> 
  143. <# } else if ( data.sizes && data.sizes.large ) { #> 
  144. <img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" alt="" /> 
  145. <# } else if ( data.sizes && data.sizes.full ) { #> 
  146. <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" alt="" /> 
  147. <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #> 
  148. <img class="details-image icon" src="{{ data.icon }}" draggable="false" alt="" /> 
  149. <# } #> 
  150.  
  151. <# if ( 'audio' === data.type ) { #> 
  152. <div class="wp-media-wrapper"> 
  153. <audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none"> 
  154. <source type="{{ data.mime }}" src="{{ data.url }}"/> 
  155. </audio> 
  156. </div> 
  157. <# } else if ( 'video' === data.type ) { 
  158. var w_rule = ''; 
  159. if ( data.width ) { 
  160. w_rule = 'width: ' + data.width + 'px;'; 
  161. } else if ( wp.media.view.settings.contentWidth ) { 
  162. w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; 
  163. #> 
  164. <div style="{{ w_rule }}" class="wp-media-wrapper wp-video"> 
  165. <video controls="controls" class="wp-video-shortcode" preload="metadata" 
  166. <# if ( data.width ) { #>width="{{ data.width }}"<# } #> 
  167. <# if ( data.height ) { #>height="{{ data.height }}"<# } #> 
  168. <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>> 
  169. <source type="{{ data.mime }}" src="{{ data.url }}"/> 
  170. </video> 
  171. </div> 
  172. <# } #> 
  173.  
  174. <div class="attachment-actions"> 
  175. <# if ( 'image' === data.type && ! data.uploading && data.sizes && data.can.save ) { #> 
  176. <button type="button" class="button edit-attachment"><?php _e( 'Edit Image' ); ?></button> 
  177. <# } else if ( 'pdf' === data.subtype && data.sizes ) { #> 
  178. <?php _e( 'Document Preview' ); ?> 
  179. <# } #> 
  180. </div> 
  181. </div> 
  182. </div> 
  183. <div class="attachment-info"> 
  184. <span class="settings-save-status"> 
  185. <span class="spinner"></span> 
  186. <span class="saved"><?php esc_html_e('Saved.'); ?></span> 
  187. </span> 
  188. <div class="details"> 
  189. <div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div> 
  190. <div class="filename"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div> 
  191. <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> 
  192.  
  193. <div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div> 
  194. <# if ( 'image' === data.type && ! data.uploading ) { #> 
  195. <# if ( data.width && data.height ) { #> 
  196. <div class="dimensions"><strong><?php _e( 'Dimensions:' ); ?></strong> {{ data.width }} × {{ data.height }}</div> 
  197. <# } #> 
  198. <# } #> 
  199.  
  200. <# if ( data.fileLength ) { #> 
  201. <div class="file-length"><strong><?php _e( 'Length:' ); ?></strong> {{ data.fileLength }}</div> 
  202. <# } #> 
  203.  
  204. <# if ( 'audio' === data.type && data.meta.bitrate ) { #> 
  205. <div class="bitrate"> 
  206. <strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s 
  207. <# if ( data.meta.bitrate_mode ) { #> 
  208. {{ ' ' + data.meta.bitrate_mode.toUpperCase() }} 
  209. <# } #> 
  210. </div> 
  211. <# } #> 
  212.  
  213. <div class="compat-meta"> 
  214. <# if ( data.compat && data.compat.meta ) { #> 
  215. {{{ data.compat.meta }}} 
  216. <# } #> 
  217. </div> 
  218. </div> 
  219.  
  220. <div class="settings"> 
  221. <label class="setting" data-setting="url"> 
  222. <span class="name"><?php _e('URL'); ?></span> 
  223. <input type="text" value="{{ data.url }}" readonly /> 
  224. </label> 
  225. <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 
  226. <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> 
  227. <label class="setting" data-setting="title"> 
  228. <span class="name"><?php _e('Title'); ?></span> 
  229. <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 
  230. </label> 
  231. <?php endif; ?> 
  232. <# if ( 'audio' === data.type ) { #> 
  233. <?php foreach ( array( 
  234. 'artist' => __( 'Artist' ),  
  235. 'album' => __( 'Album' ),  
  236. ) as $key => $label ) : ?> 
  237. <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> 
  238. <span class="name"><?php echo $label ?></span> 
  239. <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> 
  240. </label> 
  241. <?php endforeach; ?> 
  242. <# } #> 
  243. <label class="setting" data-setting="caption"> 
  244. <span class="name"><?php _e( 'Caption' ); ?></span> 
  245. <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 
  246. </label> 
  247. <# if ( 'image' === data.type ) { #> 
  248. <label class="setting" data-setting="alt"> 
  249. <span class="name"><?php _e( 'Alt Text' ); ?></span> 
  250. <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 
  251. </label> 
  252. <# } #> 
  253. <label class="setting" data-setting="description"> 
  254. <span class="name"><?php _e('Description'); ?></span> 
  255. <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 
  256. </label> 
  257. <label class="setting"> 
  258. <span class="name"><?php _e( 'Uploaded By' ); ?></span> 
  259. <span class="value">{{ data.authorName }}</span> 
  260. </label> 
  261. <# if ( data.uploadedToTitle ) { #> 
  262. <label class="setting"> 
  263. <span class="name"><?php _e( 'Uploaded To' ); ?></span> 
  264. <# if ( data.uploadedToLink ) { #> 
  265. <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> 
  266. <# } else { #> 
  267. <span class="value">{{ data.uploadedToTitle }}</span> 
  268. <# } #> 
  269. </label> 
  270. <# } #> 
  271. <div class="attachment-compat"></div> 
  272. </div> 
  273.  
  274. <div class="actions"> 
  275. <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> 
  276. <# if ( data.can.save ) { #> | 
  277. <a href="post.php?post={{ data.id }}&action=edit"><?php _e( 'Edit more details' ); ?></a> 
  278. <# } #> 
  279. <# if ( ! data.uploading && data.can.remove ) { #> | 
  280. <?php if ( MEDIA_TRASH ): ?> 
  281. <# if ( 'trash' === data.status ) { #> 
  282. <button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button> 
  283. <# } else { #> 
  284. <button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button> 
  285. <# } #> 
  286. <?php else: ?> 
  287. <button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button> 
  288. <?php endif; ?> 
  289. <# } #> 
  290. </div> 
  291.  
  292. </div> 
  293. </script> 
  294.  
  295. <script type="text/html" id="tmpl-attachment"> 
  296. <div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> 
  297. <div class="thumbnail"> 
  298. <# if ( data.uploading ) { #> 
  299. <div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div> 
  300. <# } else if ( 'image' === data.type && data.sizes ) { #> 
  301. <div class="centered"> 
  302. <img src="{{ data.size.url }}" draggable="false" alt="" /> 
  303. </div> 
  304. <# } else { #> 
  305. <div class="centered"> 
  306. <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> 
  307. <img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" /> 
  308. <# } else if ( data.sizes && data.sizes.medium ) { #> 
  309. <img src="{{ data.sizes.medium.url }}" class="thumbnail" draggable="false" alt="" /> 
  310. <# } else { #> 
  311. <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> 
  312. <# } #> 
  313. </div> 
  314. <div class="filename"> 
  315. <div>{{ data.filename }}</div> 
  316. </div> 
  317. <# } #> 
  318. </div> 
  319. <# if ( data.buttons.close ) { #> 
  320. <button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text"><?php _e( 'Remove' ); ?></span></button> 
  321. <# } #> 
  322. </div> 
  323. <# if ( data.buttons.check ) { #> 
  324. <button type="button" class="button-link check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text"><?php _e( 'Deselect' ); ?></span></button> 
  325. <# } #> 
  326. <# 
  327. var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; 
  328. if ( data.describe ) { 
  329. if ( 'image' === data.type ) { #> 
  330. <input type="text" value="{{ data.caption }}" class="describe" data-setting="caption" 
  331. placeholder="<?php esc_attr_e('Caption this image…'); ?>" {{ maybeReadOnly }} /> 
  332. <# } else { #> 
  333. <input type="text" value="{{ data.title }}" class="describe" data-setting="title" 
  334. <# if ( 'video' === data.type ) { #> 
  335. placeholder="<?php esc_attr_e('Describe this video…'); ?>" 
  336. <# } else if ( 'audio' === data.type ) { #> 
  337. placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" 
  338. <# } else { #> 
  339. placeholder="<?php esc_attr_e('Describe this media file…'); ?>" 
  340. <# } #> {{ maybeReadOnly }} /> 
  341. <# } 
  342. } #> 
  343. </script> 
  344.  
  345. <script type="text/html" id="tmpl-attachment-details"> 
  346. <h2> 
  347. <?php _e( 'Attachment Details' ); ?> 
  348. <span class="settings-save-status"> 
  349. <span class="spinner"></span> 
  350. <span class="saved"><?php esc_html_e('Saved.'); ?></span> 
  351. </span> 
  352. </h2> 
  353. <div class="attachment-info"> 
  354. <div class="thumbnail thumbnail-{{ data.type }}"> 
  355. <# if ( data.uploading ) { #> 
  356. <div class="media-progress-bar"><div></div></div> 
  357. <# } else if ( 'image' === data.type && data.sizes ) { #> 
  358. <img src="{{ data.size.url }}" draggable="false" alt="" /> 
  359. <# } else { #> 
  360. <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> 
  361. <# } #> 
  362. </div> 
  363. <div class="details"> 
  364. <div class="filename">{{ data.filename }}</div> 
  365. <div class="uploaded">{{ data.dateFormatted }}</div> 
  366.  
  367. <div class="file-size">{{ data.filesizeHumanReadable }}</div> 
  368. <# if ( 'image' === data.type && ! data.uploading ) { #> 
  369. <# if ( data.width && data.height ) { #> 
  370. <div class="dimensions">{{ data.width }} × {{ data.height }}</div> 
  371. <# } #> 
  372.  
  373. <# if ( data.can.save && data.sizes ) { #> 
  374. <a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> 
  375. <# } #> 
  376. <# } #> 
  377.  
  378. <# if ( data.fileLength ) { #> 
  379. <div class="file-length"><?php _e( 'Length:' ); ?> {{ data.fileLength }}</div> 
  380. <# } #> 
  381.  
  382. <# if ( ! data.uploading && data.can.remove ) { #> 
  383. <?php if ( MEDIA_TRASH ): ?> 
  384. <# if ( 'trash' === data.status ) { #> 
  385. <button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button> 
  386. <# } else { #> 
  387. <button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button> 
  388. <# } #> 
  389. <?php else: ?> 
  390. <button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button> 
  391. <?php endif; ?> 
  392. <# } #> 
  393.  
  394. <div class="compat-meta"> 
  395. <# if ( data.compat && data.compat.meta ) { #> 
  396. {{{ data.compat.meta }}} 
  397. <# } #> 
  398. </div> 
  399. </div> 
  400. </div> 
  401.  
  402. <label class="setting" data-setting="url"> 
  403. <span class="name"><?php _e('URL'); ?></span> 
  404. <input type="text" value="{{ data.url }}" readonly /> 
  405. </label> 
  406. <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 
  407. <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> 
  408. <label class="setting" data-setting="title"> 
  409. <span class="name"><?php _e('Title'); ?></span> 
  410. <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 
  411. </label> 
  412. <?php endif; ?> 
  413. <# if ( 'audio' === data.type ) { #> 
  414. <?php foreach ( array( 
  415. 'artist' => __( 'Artist' ),  
  416. 'album' => __( 'Album' ),  
  417. ) as $key => $label ) : ?> 
  418. <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> 
  419. <span class="name"><?php echo $label ?></span> 
  420. <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> 
  421. </label> 
  422. <?php endforeach; ?> 
  423. <# } #> 
  424. <label class="setting" data-setting="caption"> 
  425. <span class="name"><?php _e('Caption'); ?></span> 
  426. <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 
  427. </label> 
  428. <# if ( 'image' === data.type ) { #> 
  429. <label class="setting" data-setting="alt"> 
  430. <span class="name"><?php _e('Alt Text'); ?></span> 
  431. <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 
  432. </label> 
  433. <# } #> 
  434. <label class="setting" data-setting="description"> 
  435. <span class="name"><?php _e('Description'); ?></span> 
  436. <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 
  437. </label> 
  438. </script> 
  439.  
  440. <script type="text/html" id="tmpl-media-selection"> 
  441. <div class="selection-info"> 
  442. <span class="count"></span> 
  443. <# if ( data.editable ) { #> 
  444. <button type="button" class="button-link edit-selection"><?php _e( 'Edit Selection' ); ?></button> 
  445. <# } #> 
  446. <# if ( data.clearable ) { #> 
  447. <button type="button" class="button-link clear-selection"><?php _e( 'Clear' ); ?></button> 
  448. <# } #> 
  449. </div> 
  450. <div class="selection-view"></div> 
  451. </script> 
  452.  
  453. <script type="text/html" id="tmpl-attachment-display-settings"> 
  454. <h2><?php _e( 'Attachment Display Settings' ); ?></h2> 
  455.  
  456. <# if ( 'image' === data.type ) { #> 
  457. <label class="setting"> 
  458. <span><?php _e('Alignment'); ?></span> 
  459. <select class="alignment" 
  460. data-setting="align" 
  461. <# if ( data.userSettings ) { #> 
  462. data-user-setting="align" 
  463. <# } #>> 
  464.  
  465. <option value="left"> 
  466. <?php esc_html_e( 'Left' ); ?> 
  467. </option> 
  468. <option value="center"> 
  469. <?php esc_html_e( 'Center' ); ?> 
  470. </option> 
  471. <option value="right"> 
  472. <?php esc_html_e( 'Right' ); ?> 
  473. </option> 
  474. <option value="none" selected> 
  475. <?php esc_html_e( 'None' ); ?> 
  476. </option> 
  477. </select> 
  478. </label> 
  479. <# } #> 
  480.  
  481. <div class="setting"> 
  482. <label> 
  483. <# if ( data.model.canEmbed ) { #> 
  484. <span><?php _e('Embed or Link'); ?></span> 
  485. <# } else { #> 
  486. <span><?php _e('Link To'); ?></span> 
  487. <# } #> 
  488.  
  489. <select class="link-to" 
  490. data-setting="link" 
  491. <# if ( data.userSettings && ! data.model.canEmbed ) { #> 
  492. data-user-setting="urlbutton" 
  493. <# } #>> 
  494.  
  495. <# if ( data.model.canEmbed ) { #> 
  496. <option value="embed" selected> 
  497. <?php esc_html_e( 'Embed Media Player' ); ?> 
  498. </option> 
  499. <option value="file"> 
  500. <# } else { #> 
  501. <option value="none" selected> 
  502. <?php esc_html_e( 'None' ); ?> 
  503. </option> 
  504. <option value="file"> 
  505. <# } #> 
  506. <# if ( data.model.canEmbed ) { #> 
  507. <?php esc_html_e( 'Link to Media File' ); ?> 
  508. <# } else { #> 
  509. <?php esc_html_e( 'Media File' ); ?> 
  510. <# } #> 
  511. </option> 
  512. <option value="post"> 
  513. <# if ( data.model.canEmbed ) { #> 
  514. <?php esc_html_e( 'Link to Attachment Page' ); ?> 
  515. <# } else { #> 
  516. <?php esc_html_e( 'Attachment Page' ); ?> 
  517. <# } #> 
  518. </option> 
  519. <# if ( 'image' === data.type ) { #> 
  520. <option value="custom"> 
  521. <?php esc_html_e( 'Custom URL' ); ?> 
  522. </option> 
  523. <# } #> 
  524. </select> 
  525. </label> 
  526. <input type="text" class="link-to-custom" data-setting="linkUrl" /> 
  527. </div> 
  528.  
  529. <# if ( 'undefined' !== typeof data.sizes ) { #> 
  530. <label class="setting"> 
  531. <span><?php _e('Size'); ?></span> 
  532. <select class="size" name="size" 
  533. data-setting="size" 
  534. <# if ( data.userSettings ) { #> 
  535. data-user-setting="imgsize" 
  536. <# } #>> 
  537. <?php 
  538. /** This filter is documented in wp-admin/includes/media.php */ 
  539. 'thumbnail' => __('Thumbnail'),  
  540. 'medium' => __('Medium'),  
  541. 'large' => __('Large'),  
  542. 'full' => __('Full Size'),  
  543. ) ); 
  544.  
  545. foreach ( $sizes as $value => $name ) : ?> 
  546. <# 
  547. var size = data.sizes['<?php echo esc_js( $value ); ?>']; 
  548. if ( size ) { #> 
  549. <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'full' ); ?>> 
  550. <?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} 
  551. </option> 
  552. <# } #> 
  553. <?php endforeach; ?> 
  554. </select> 
  555. </label> 
  556. <# } #> 
  557. </script> 
  558.  
  559. <script type="text/html" id="tmpl-gallery-settings"> 
  560. <h2><?php _e( 'Gallery Settings' ); ?></h2> 
  561.  
  562. <label class="setting"> 
  563. <span><?php _e('Link To'); ?></span> 
  564. <select class="link-to" 
  565. data-setting="link" 
  566. <# if ( data.userSettings ) { #> 
  567. data-user-setting="urlbutton" 
  568. <# } #>> 
  569.  
  570. <option value="post" <# if ( ! wp.media.galleryDefaults.link || 'post' == wp.media.galleryDefaults.link ) { 
  571. #>selected="selected"<# } 
  572. #>> 
  573. <?php esc_html_e( 'Attachment Page' ); ?> 
  574. </option> 
  575. <option value="file" <# if ( 'file' == wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>> 
  576. <?php esc_html_e( 'Media File' ); ?> 
  577. </option> 
  578. <option value="none" <# if ( 'none' == wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>> 
  579. <?php esc_html_e( 'None' ); ?> 
  580. </option> 
  581. </select> 
  582. </label> 
  583.  
  584. <label class="setting"> 
  585. <span><?php _e('Columns'); ?></span> 
  586. <select class="columns" name="columns" 
  587. data-setting="columns"> 
  588. <?php for ( $i = 1; $i <= 9; $i++ ) : ?> 
  589. <option value="<?php echo esc_attr( $i ); ?>" <# 
  590. if ( <?php echo $i ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# } 
  591. #>> 
  592. <?php echo esc_html( $i ); ?> 
  593. </option> 
  594. <?php endfor; ?> 
  595. </select> 
  596. </label> 
  597.  
  598. <label class="setting"> 
  599. <span><?php _e( 'Random Order' ); ?></span> 
  600. <input type="checkbox" data-setting="_orderbyRandom" /> 
  601. </label> 
  602.  
  603. <label class="setting size"> 
  604. <span><?php _e( 'Size' ); ?></span> 
  605. <select class="size" name="size" 
  606. data-setting="size" 
  607. <# if ( data.userSettings ) { #> 
  608. data-user-setting="imgsize" 
  609. <# } #> 
  610. <?php 
  611. // This filter is documented in wp-admin/includes/media.php 
  612. $size_names = apply_filters( 'image_size_names_choose', array( 
  613. 'thumbnail' => __( 'Thumbnail' ),  
  614. 'medium' => __( 'Medium' ),  
  615. 'large' => __( 'Large' ),  
  616. 'full' => __( 'Full Size' ),  
  617. ) ); 
  618.  
  619. foreach ( $size_names as $size => $label ) : ?> 
  620. <option value="<?php echo esc_attr( $size ); ?>"> 
  621. <?php echo esc_html( $label ); ?> 
  622. </option> 
  623. <?php endforeach; ?> 
  624. </select> 
  625. </label> 
  626. </script> 
  627.  
  628. <script type="text/html" id="tmpl-playlist-settings"> 
  629. <h2><?php _e( 'Playlist Settings' ); ?></h2> 
  630.  
  631. <# var emptyModel = _.isEmpty( data.model ),  
  632. isVideo = 'video' === data.controller.get('library').props.get('type'); #> 
  633.  
  634. <label class="setting"> 
  635. <input type="checkbox" data-setting="tracklist" <# if ( emptyModel ) { #> 
  636. checked="checked" 
  637. <# } #> /> 
  638. <# if ( isVideo ) { #> 
  639. <span><?php _e( 'Show Video List' ); ?></span> 
  640. <# } else { #> 
  641. <span><?php _e( 'Show Tracklist' ); ?></span> 
  642. <# } #> 
  643. </label> 
  644.  
  645. <# if ( ! isVideo ) { #> 
  646. <label class="setting"> 
  647. <input type="checkbox" data-setting="artists" <# if ( emptyModel ) { #> 
  648. checked="checked" 
  649. <# } #> /> 
  650. <span><?php _e( 'Show Artist Name in Tracklist' ); ?></span> 
  651. </label> 
  652. <# } #> 
  653.  
  654. <label class="setting"> 
  655. <input type="checkbox" data-setting="images" <# if ( emptyModel ) { #> 
  656. checked="checked" 
  657. <# } #> /> 
  658. <span><?php _e( 'Show Images' ); ?></span> 
  659. </label> 
  660. </script> 
  661.  
  662. <script type="text/html" id="tmpl-embed-link-settings"> 
  663. <label class="setting link-text"> 
  664. <span><?php _e( 'Link Text' ); ?></span> 
  665. <input type="text" class="alignment" data-setting="linkText" /> 
  666. </label> 
  667. <div class="embed-container" style="display: none;"> 
  668. <div class="embed-preview"></div> 
  669. </div> 
  670. </script> 
  671.  
  672. <script type="text/html" id="tmpl-embed-image-settings"> 
  673. <div class="thumbnail"> 
  674. <img src="{{ data.model.url }}" draggable="false" alt="" /> 
  675. </div> 
  676.  
  677. <?php 
  678. /** This filter is documented in wp-admin/includes/media.php */ 
  679. if ( ! apply_filters( 'disable_captions', '' ) ) : ?> 
  680. <label class="setting caption"> 
  681. <span><?php _e('Caption'); ?></span> 
  682. <textarea data-setting="caption" /> 
  683. </label> 
  684. <?php endif; ?> 
  685.  
  686. <label class="setting alt-text"> 
  687. <span><?php _e('Alt Text'); ?></span> 
  688. <input type="text" data-setting="alt" /> 
  689. </label> 
  690.  
  691. <div class="setting align"> 
  692. <span><?php _e('Align'); ?></span> 
  693. <div class="button-group button-large" data-setting="align"> 
  694. <button class="button" value="left"> 
  695. <?php esc_html_e( 'Left' ); ?> 
  696. </button> 
  697. <button class="button" value="center"> 
  698. <?php esc_html_e( 'Center' ); ?> 
  699. </button> 
  700. <button class="button" value="right"> 
  701. <?php esc_html_e( 'Right' ); ?> 
  702. </button> 
  703. <button class="button active" value="none"> 
  704. <?php esc_html_e( 'None' ); ?> 
  705. </button> 
  706. </div> 
  707. </div> 
  708.  
  709. <div class="setting link-to"> 
  710. <span><?php _e('Link To'); ?></span> 
  711. <div class="button-group button-large" data-setting="link"> 
  712. <button class="button" value="file"> 
  713. <?php esc_html_e( 'Image URL' ); ?> 
  714. </button> 
  715. <button class="button" value="custom"> 
  716. <?php esc_html_e( 'Custom URL' ); ?> 
  717. </button> 
  718. <button class="button active" value="none"> 
  719. <?php esc_html_e( 'None' ); ?> 
  720. </button> 
  721. </div> 
  722. <input type="text" class="link-to-custom" data-setting="linkUrl" /> 
  723. </div> 
  724. </script> 
  725.  
  726. <script type="text/html" id="tmpl-image-details"> 
  727. <div class="media-embed"> 
  728. <div class="embed-media-settings"> 
  729. <div class="column-image"> 
  730. <div class="image"> 
  731. <img src="{{ data.model.url }}" draggable="false" alt="" /> 
  732.  
  733. <# if ( data.attachment && window.imageEdit ) { #> 
  734. <div class="actions"> 
  735. <input type="button" class="edit-attachment button" value="<?php esc_attr_e( 'Edit Original' ); ?>" /> 
  736. <input type="button" class="replace-attachment button" value="<?php esc_attr_e( 'Replace' ); ?>" /> 
  737. </div> 
  738. <# } #> 
  739. </div> 
  740. </div> 
  741. <div class="column-settings"> 
  742. <?php 
  743. /** This filter is documented in wp-admin/includes/media.php */ 
  744. if ( ! apply_filters( 'disable_captions', '' ) ) : ?> 
  745. <label class="setting caption"> 
  746. <span><?php _e('Caption'); ?></span> 
  747. <textarea data-setting="caption">{{ data.model.caption }}</textarea> 
  748. </label> 
  749. <?php endif; ?> 
  750.  
  751. <label class="setting alt-text"> 
  752. <span><?php _e('Alternative Text'); ?></span> 
  753. <input type="text" data-setting="alt" value="{{ data.model.alt }}" /> 
  754. </label> 
  755.  
  756. <h2><?php _e( 'Display Settings' ); ?></h2> 
  757. <div class="setting align"> 
  758. <span><?php _e('Align'); ?></span> 
  759. <div class="button-group button-large" data-setting="align"> 
  760. <button class="button" value="left"> 
  761. <?php esc_html_e( 'Left' ); ?> 
  762. </button> 
  763. <button class="button" value="center"> 
  764. <?php esc_html_e( 'Center' ); ?> 
  765. </button> 
  766. <button class="button" value="right"> 
  767. <?php esc_html_e( 'Right' ); ?> 
  768. </button> 
  769. <button class="button active" value="none"> 
  770. <?php esc_html_e( 'None' ); ?> 
  771. </button> 
  772. </div> 
  773. </div> 
  774.  
  775. <# if ( data.attachment ) { #> 
  776. <# if ( 'undefined' !== typeof data.attachment.sizes ) { #> 
  777. <label class="setting size"> 
  778. <span><?php _e('Size'); ?></span> 
  779. <select class="size" name="size" 
  780. data-setting="size" 
  781. <# if ( data.userSettings ) { #> 
  782. data-user-setting="imgsize" 
  783. <# } #>> 
  784. <?php 
  785. /** This filter is documented in wp-admin/includes/media.php */ 
  786. 'thumbnail' => __('Thumbnail'),  
  787. 'medium' => __('Medium'),  
  788. 'large' => __('Large'),  
  789. 'full' => __('Full Size'),  
  790. ) ); 
  791.  
  792. foreach ( $sizes as $value => $name ) : ?> 
  793. <# 
  794. var size = data.sizes['<?php echo esc_js( $value ); ?>']; 
  795. if ( size ) { #> 
  796. <option value="<?php echo esc_attr( $value ); ?>"> 
  797. <?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} 
  798. </option> 
  799. <# } #> 
  800. <?php endforeach; ?> 
  801. <option value="<?php echo esc_attr( 'custom' ); ?>"> 
  802. <?php _e( 'Custom Size' ); ?> 
  803. </option> 
  804. </select> 
  805. </label> 
  806. <# } #> 
  807. <div class="custom-size<# if ( data.model.size !== 'custom' ) { #> hidden<# } #>"> 
  808. <label><span><?php _e( 'Width' ); ?> <small>(px)</small></span> <input data-setting="customWidth" type="number" step="1" value="{{ data.model.customWidth }}" /></label><span class="sep">×</span><label><span><?php _e( 'Height' ); ?> <small>(px)</small></span><input data-setting="customHeight" type="number" step="1" value="{{ data.model.customHeight }}" /></label> 
  809. </div> 
  810. <# } #> 
  811.  
  812. <div class="setting link-to"> 
  813. <span><?php _e('Link To'); ?></span> 
  814. <select data-setting="link"> 
  815. <# if ( data.attachment ) { #> 
  816. <option value="file"> 
  817. <?php esc_html_e( 'Media File' ); ?> 
  818. </option> 
  819. <option value="post"> 
  820. <?php esc_html_e( 'Attachment Page' ); ?> 
  821. </option> 
  822. <# } else { #> 
  823. <option value="file"> 
  824. <?php esc_html_e( 'Image URL' ); ?> 
  825. </option> 
  826. <# } #> 
  827. <option value="custom"> 
  828. <?php esc_html_e( 'Custom URL' ); ?> 
  829. </option> 
  830. <option value="none"> 
  831. <?php esc_html_e( 'None' ); ?> 
  832. </option> 
  833. </select> 
  834. <input type="text" class="link-to-custom" data-setting="linkUrl" /> 
  835. </div> 
  836. <div class="advanced-section"> 
  837. <h2><button type="button" class="button-link advanced-toggle"><?php _e( 'Advanced Options' ); ?></button></h2> 
  838. <div class="advanced-settings hidden"> 
  839. <div class="advanced-image"> 
  840. <label class="setting title-text"> 
  841. <span><?php _e('Image Title Attribute'); ?></span> 
  842. <input type="text" data-setting="title" value="{{ data.model.title }}" /> 
  843. </label> 
  844. <label class="setting extra-classes"> 
  845. <span><?php _e('Image CSS Class'); ?></span> 
  846. <input type="text" data-setting="extraClasses" value="{{ data.model.extraClasses }}" /> 
  847. </label> 
  848. </div> 
  849. <div class="advanced-link"> 
  850. <div class="setting link-target"> 
  851. <label><input type="checkbox" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>><?php _e( 'Open link in a new tab' ); ?></label> 
  852. </div> 
  853. <label class="setting link-rel"> 
  854. <span><?php _e('Link Rel'); ?></span> 
  855. <input type="text" data-setting="linkRel" value="{{ data.model.linkClassName }}" /> 
  856. </label> 
  857. <label class="setting link-class-name"> 
  858. <span><?php _e('Link CSS Class'); ?></span> 
  859. <input type="text" data-setting="linkClassName" value="{{ data.model.linkClassName }}" /> 
  860. </label> 
  861. </div> 
  862. </div> 
  863. </div> 
  864. </div> 
  865. </div> 
  866. </div> 
  867. </script> 
  868.  
  869. <script type="text/html" id="tmpl-image-editor"> 
  870. <div id="media-head-{{ data.id }}"></div> 
  871. <div id="image-editor-{{ data.id }}"></div> 
  872. </script> 
  873.  
  874. <script type="text/html" id="tmpl-audio-details"> 
  875. <# var ext, html5types = { 
  876. mp3: wp.media.view.settings.embedMimes.mp3,  
  877. ogg: wp.media.view.settings.embedMimes.ogg 
  878. }; #> 
  879.  
  880. <?php $audio_types = wp_get_audio_extensions(); ?> 
  881. <div class="media-embed media-embed-details"> 
  882. <div class="embed-media-settings embed-audio-settings"> 
  883.  
  884. <# if ( ! _.isEmpty( data.model.src ) ) { 
  885. ext = data.model.src.split('.').pop(); 
  886. if ( html5types[ ext ] ) { 
  887. delete html5types[ ext ]; 
  888. #> 
  889. <label class="setting"> 
  890. <span>SRC</span> 
  891. <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" /> 
  892. <button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button> 
  893. </label> 
  894. <# } #> 
  895. <?php 
  896.  
  897. foreach ( $audio_types as $type ): 
  898. ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { 
  899. if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) { 
  900. delete html5types.<?php echo $type ?>; 
  901. #> 
  902. <label class="setting"> 
  903. <span><?php echo strtoupper( $type ) ?></span> 
  904. <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" /> 
  905. <button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button> 
  906. </label> 
  907. <# } #> 
  908. <?php endforeach ?> 
  909.  
  910. <# if ( ! _.isEmpty( html5types ) ) { #> 
  911. <div class="setting"> 
  912. <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ) ?></span> 
  913. <div class="button-large"> 
  914. <# _.each( html5types, function (mime, type) { #> 
  915. <button class="button add-media-source" data-mime="{{ mime }}">{{ type }}</button> 
  916. <# } ) #> 
  917. </div> 
  918. </div> 
  919. <# } #> 
  920.  
  921. <div class="setting preload"> 
  922. <span><?php _e( 'Preload' ); ?></span> 
  923. <div class="button-group button-large" data-setting="preload"> 
  924. <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload' ); ?></button> 
  925. <button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> 
  926. <button class="button active" value="none"><?php _e( 'None' ); ?></button> 
  927. </div> 
  928. </div> 
  929.  
  930. <label class="setting checkbox-setting"> 
  931. <input type="checkbox" data-setting="autoplay" /> 
  932. <span><?php _e( 'Autoplay' ); ?></span> 
  933. </label> 
  934.  
  935. <label class="setting checkbox-setting"> 
  936. <input type="checkbox" data-setting="loop" /> 
  937. <span><?php _e( 'Loop' ); ?></span> 
  938. </label> 
  939. </div> 
  940. </div> 
  941. </script> 
  942.  
  943. <script type="text/html" id="tmpl-video-details"> 
  944. <# var ext, html5types = { 
  945. mp4: wp.media.view.settings.embedMimes.mp4,  
  946. ogv: wp.media.view.settings.embedMimes.ogv,  
  947. webm: wp.media.view.settings.embedMimes.webm 
  948. }; #> 
  949.  
  950. <?php $video_types = wp_get_video_extensions(); ?> 
  951. <div class="media-embed media-embed-details"> 
  952. <div class="embed-media-settings embed-video-settings"> 
  953. <div class="wp-video-holder"> 
  954. <# 
  955. var w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width,  
  956. h = ! data.model.height ? 360 : data.model.height; 
  957.  
  958. if ( data.model.width && w !== data.model.width ) { 
  959. h = Math.ceil( ( h * w ) / data.model.width ); 
  960. #> 
  961.  
  962.  
  963. <# if ( ! _.isEmpty( data.model.src ) ) { 
  964. ext = data.model.src.split('.').pop(); 
  965. if ( html5types[ ext ] ) { 
  966. delete html5types[ ext ]; 
  967. #> 
  968. <label class="setting"> 
  969. <span>SRC</span> 
  970. <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" /> 
  971. <button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button> 
  972. </label> 
  973. <# } #> 
  974. <?php foreach ( $video_types as $type ): 
  975. ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { 
  976. if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) { 
  977. delete html5types.<?php echo $type ?>; 
  978. #> 
  979. <label class="setting"> 
  980. <span><?php echo strtoupper( $type ) ?></span> 
  981. <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" /> 
  982. <button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button> 
  983. </label> 
  984. <# } #> 
  985. <?php endforeach ?> 
  986. </div> 
  987.  
  988. <# if ( ! _.isEmpty( html5types ) ) { #> 
  989. <div class="setting"> 
  990. <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ); ?></span> 
  991. <div class="button-large"> 
  992. <# _.each( html5types, function (mime, type) { #> 
  993. <button class="button add-media-source" data-mime="{{ mime }}">{{ type }}</button> 
  994. <# } ) #> 
  995. </div> 
  996. </div> 
  997. <# } #> 
  998.  
  999. <# if ( ! _.isEmpty( data.model.poster ) ) { #> 
  1000. <label class="setting"> 
  1001. <span><?php _e( 'Poster Image' ); ?></span> 
  1002. <input type="text" disabled="disabled" data-setting="poster" value="{{ data.model.poster }}" /> 
  1003. <button type="button" class="button-link remove-setting"><?php _e( 'Remove poster image' ); ?></button> 
  1004. </label> 
  1005. <# } #> 
  1006. <div class="setting preload"> 
  1007. <span><?php _e( 'Preload' ); ?></span> 
  1008. <div class="button-group button-large" data-setting="preload"> 
  1009. <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload' ); ?></button> 
  1010. <button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> 
  1011. <button class="button active" value="none"><?php _e( 'None' ); ?></button> 
  1012. </div> 
  1013. </div> 
  1014.  
  1015. <label class="setting checkbox-setting"> 
  1016. <input type="checkbox" data-setting="autoplay" /> 
  1017. <span><?php _e( 'Autoplay' ); ?></span> 
  1018. </label> 
  1019.  
  1020. <label class="setting checkbox-setting"> 
  1021. <input type="checkbox" data-setting="loop" /> 
  1022. <span><?php _e( 'Loop' ); ?></span> 
  1023. </label> 
  1024.  
  1025. <label class="setting" data-setting="content"> 
  1026. <span><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></span> 
  1027. <# 
  1028. var content = ''; 
  1029. if ( ! _.isEmpty( data.model.content ) ) { 
  1030. var tracks = jQuery( data.model.content ).filter( 'track' ); 
  1031. _.each( tracks.toArray(), function (track) { 
  1032. content += track.outerHTML; #> 
  1033. <p> 
  1034. <input class="content-track" type="text" value="{{ track.outerHTML }}" /> 
  1035. <button type="button" class="button-link remove-setting remove-track"><?php _ex( 'Remove video track', 'media' ); ?></button> 
  1036. </p> 
  1037. <# } ); #> 
  1038. <# } else { #> 
  1039. <em><?php _e( 'There are no associated subtitles.' ); ?></em> 
  1040. <# } #> 
  1041. <textarea class="hidden content-setting">{{ content }}</textarea> 
  1042. </label> 
  1043. </div> 
  1044. </div> 
  1045. </script> 
  1046.  
  1047. <script type="text/html" id="tmpl-editor-gallery"> 
  1048. <# if ( data.attachments.length ) { #> 
  1049. <div class="gallery gallery-columns-{{ data.columns }}"> 
  1050. <# _.each( data.attachments, function( attachment, index ) { #> 
  1051. <dl class="gallery-item"> 
  1052. <dt class="gallery-icon"> 
  1053. <# if ( attachment.thumbnail ) { #> 
  1054. <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" alt="" /> 
  1055. <# } else { #> 
  1056. <img src="{{ attachment.url }}" alt="" /> 
  1057. <# } #> 
  1058. </dt> 
  1059. <# if ( attachment.caption ) { #> 
  1060. <dd class="wp-caption-text gallery-caption"> 
  1061. {{{ data.verifyHTML( attachment.caption ) }}} 
  1062. </dd> 
  1063. <# } #> 
  1064. </dl> 
  1065. <# if ( index % data.columns === data.columns - 1 ) { #> 
  1066. <br style="clear: both;"> 
  1067. <# } #> 
  1068. <# } ); #> 
  1069. </div> 
  1070. <# } else { #> 
  1071. <div class="wpview-error"> 
  1072. <div class="dashicons dashicons-format-gallery"></div><p><?php _e( 'No items found.' ); ?></p> 
  1073. </div> 
  1074. <# } #> 
  1075. </script> 
  1076.  
  1077. <script type="text/html" id="tmpl-crop-content"> 
  1078. <img class="crop-image" src="{{ data.url }}" alt="<?php esc_attr_e( 'Image crop area preview. Requires mouse interaction.' ); ?>"> 
  1079. <div class="upload-errors"></div> 
  1080. </script> 
  1081.  
  1082. <script type="text/html" id="tmpl-site-icon-preview"> 
  1083. <h2><?php _e( 'Preview' ); ?></h2> 
  1084. <strong aria-hidden="true"><?php _e( 'As a browser icon' ); ?></strong> 
  1085. <div class="favicon-preview"> 
  1086. <img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" height="" alt="" /> 
  1087.  
  1088. <div class="favicon"> 
  1089. <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/> 
  1090. </div> 
  1091. <span class="browser-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></span> 
  1092. </div> 
  1093.  
  1094. <strong aria-hidden="true"><?php _e( 'As an app icon' ); ?></strong> 
  1095. <div class="app-icon-preview"> 
  1096. <img id="preview-app-icon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/> 
  1097. </div> 
  1098. </script> 
  1099.  
  1100. <?php 
  1101.  
  1102. /** 
  1103. * Fires when the custom Backbone media templates are printed. 
  1104. * @since 3.5.0 
  1105. */