Advertisement
Guest User

custom wp_print_media_templates function

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