At long last, a first pass at bringing the image editor into the media modal. props gcorne, DH-Shredder, tomauger. see #21811.

Built from https://develop.svn.wordpress.org/trunk@27445


git-svn-id: http://core.svn.wordpress.org/trunk@27292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí
2014-03-06 22:55:14 +00:00
parent f66096e4b4
commit 4bb7e03548
16 changed files with 340 additions and 73 deletions

View File

@@ -2175,12 +2175,14 @@ function wp_prepare_attachment_for_js( $attachment ) {
'nonces' => array(
'update' => false,
'delete' => false,
'edit' => false
),
'editLink' => false,
);
if ( current_user_can( 'edit_post', $attachment->ID ) ) {
$response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID );
$response['nonces']['edit'] = wp_create_nonce( 'image_editor-' . $attachment->ID );
$response['editLink'] = get_edit_post_link( $attachment->ID, 'raw' );
}
@@ -2335,6 +2337,7 @@ function wp_enqueue_media( $args = array() ) {
'cancel' => __( 'Cancel' ),
'update' => __( 'Update' ),
'replace' => __( 'Replace' ),
'back' => __( 'Back' ),
/* translators: This is a would-be plural string used in the media manager.
If there is not a word you can use in your language to avoid issues with the
lack of plural support here, turn it into "selected: %d" then translate it.
@@ -2380,6 +2383,7 @@ function wp_enqueue_media( $args = array() ) {
'imageDetailsTitle' => __( 'Image Details' ),
'imageReplaceTitle' => __( 'Replace Image' ),
'imageDetailsCancel' => __( 'Cancel Edit' ),
'editImage' => __( 'Edit Image' ),
// Edit Image
'audioDetailsTitle' => __( 'Audio Details' ),
@@ -2421,6 +2425,7 @@ function wp_enqueue_media( $args = array() ) {
wp_enqueue_script( 'media-editor' );
wp_enqueue_style( 'media-views' );
wp_enqueue_style( 'imgareaselect' );
wp_plupload_default_settings();
require_once ABSPATH . WPINC . '/media-template.php';