diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 1c09443..7012526 100644
|
|
|
5594 | 5594 | */ |
5595 | 5595 | editAttachment: function( event ) { |
5596 | 5596 | var editState = this.controller.state( 'edit-image' ); |
5597 | | event.preventDefault(); |
| 5597 | if ( window.imageEdit ) { |
| 5598 | event.preventDefault(); |
5598 | 5599 | |
5599 | | editState.set( 'image', this.model ); |
5600 | | this.controller.setState( 'edit-image' ); |
| 5600 | editState.set( 'image', this.model ); |
| 5601 | this.controller.setState( 'edit-image' ); |
| 5602 | } else { |
| 5603 | this.$el.addClass('needs-refresh'); |
| 5604 | } |
5601 | 5605 | }, |
5602 | 5606 | /** |
5603 | 5607 | * @param {Object} event |
… |
… |
|
5944 | 5948 | |
5945 | 5949 | editAttachment: function( event ) { |
5946 | 5950 | var editState = this.controller.state( 'edit-image' ); |
5947 | | event.preventDefault(); |
5948 | 5951 | |
5949 | | editState.set( 'image', this.model.attachment ); |
5950 | | this.controller.setState( 'edit-image' ); |
| 5952 | if ( window.imageEdit ) { |
| 5953 | event.preventDefault(); |
| 5954 | editState.set( 'image', this.model.attachment ); |
| 5955 | this.controller.setState( 'edit-image' ); |
| 5956 | } |
5951 | 5957 | } |
5952 | 5958 | }); |
5953 | 5959 | |
diff --git src/wp-includes/media-template.php src/wp-includes/media-template.php
index 3201b8a..6fa1d55 100644
|
|
function wp_print_media_templates() { |
666 | 666 | <div class="thumbnail"> |
667 | 667 | <img src="{{ data.model.url }}" draggable="false" /> |
668 | 668 | </div> |
669 | | <# if ( data.attachment ) { #> |
| 669 | <# if ( data.attachment && window.imageEdit ) { #> |
670 | 670 | <input type="button" class="edit-attachment button" value="<?php esc_attr_e( 'Edit Image' ); ?>" /> |
671 | 671 | <# } #> |
672 | 672 | |
diff --git src/wp-includes/media.php src/wp-includes/media.php
index 57f6311..a1afae1 100644
|
|
function wp_enqueue_media( $args = array() ) { |
2536 | 2536 | wp_enqueue_script( 'media-editor' ); |
2537 | 2537 | wp_enqueue_script( 'media-audiovideo' ); |
2538 | 2538 | wp_enqueue_style( 'media-views' ); |
| 2539 | if ( is_admin() ) { |
| 2540 | wp_enqueue_script( 'image-edit' ); |
| 2541 | } |
2539 | 2542 | wp_enqueue_style( 'imgareaselect' ); |
2540 | 2543 | wp_plupload_default_settings(); |
2541 | 2544 | |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index 8319416..ff2544a 100644
|
|
function wp_default_scripts( &$scripts ) { |
394 | 394 | |
395 | 395 | // To enqueue media-views or media-editor, call wp_enqueue_media(). |
396 | 396 | // Both rely on numerous settings, styles, and templates to operate correctly. |
397 | | $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'image-edit' ), false, 1 ); |
| 397 | $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement' ), false, 1 ); |
398 | 398 | $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 ); |
399 | 399 | $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor', 'mce-view' ), false, 1 ); |
400 | 400 | $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 ); |