diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php
index 59c018c..bb02a44 100644
a
|
b
|
function wp_print_media_templates() { |
286 | 286 | </script> |
287 | 287 | |
288 | 288 | <script type="text/html" id="tmpl-attachment-details"> |
| 289 | <# var settings = wp.media.view.settings; #> |
289 | 290 | <h3> |
290 | 291 | <?php _e('Attachment Details'); ?> |
291 | 292 | |
… |
… |
function wp_print_media_templates() { |
314 | 315 | <# } #> |
315 | 316 | |
316 | 317 | <# if ( data.can.save ) { #> |
317 | | <a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> |
| 318 | <# if ( _.contains( settings.imageEditorSupports, data.mime ) ) { #> |
| 319 | <a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> |
| 320 | <# } #> |
318 | 321 | <a class="refresh-attachment" href="#"><?php _e( 'Refresh' ); ?></a> |
319 | 322 | <# } #> |
320 | 323 | <# } #> |
diff --git a/wp-includes/media.php b/wp-includes/media.php
index 43b5aab..b08c34a 100644
a
|
b
|
function wp_enqueue_media( $args = array() ) { |
2788 | 2788 | } |
2789 | 2789 | } |
2790 | 2790 | |
| 2791 | $image_mime_types = array( 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpeg', 'image/jpeg', 'image/png', 'image/tiff', 'image/tiff', ); |
| 2792 | $settings['imageEditorSupports'] = array(); |
| 2793 | foreach ( $image_mime_types as $mime_type ) { |
| 2794 | if ( wp_image_editor_supports( array( 'mime_type' => $mime_type ) ) ) |
| 2795 | $settings['imageEditorSupports'][] = $mime_type; |
| 2796 | } |
| 2797 | |
2791 | 2798 | $hier = $post && is_post_type_hierarchical( $post->post_type ); |
2792 | 2799 | |
2793 | 2800 | $strings = array( |