X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..refs/tags/wordpress-4.5:/wp-admin/includes/image-edit.php diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 5a82b415..8947f537 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -40,13 +40,14 @@ function wp_image_editor($post_id, $msg = false) { } ?> -
+
-

+

+

@@ -54,9 +55,22 @@ function wp_image_editor($post_id, $msg = false) {

- × - ! - , 'scale')" class="button button-primary" value="" /> + +
+ +
+ + × + + ! + , 'scale')" class="button button-primary" value="" /> +
+
+
@@ -65,7 +79,7 @@ function wp_image_editor($post_id, $msg = false) {
-

+

-

+

+

@@ -97,23 +112,32 @@ function wp_image_editor($post_id, $msg = false) {
-

- - - - : - - -

- -

- - - - × - - -

+
+ +
+ + : + +
+
+ +
+ +
+ + × + +
+
+
-

+

+

-

+

-
-

+
+
-

-
+

+
+
+
-
+
-
-
, this)" class="imgedit-crop disabled" title="">
+ get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { ?> -
, this)" title="">
-
, this)" title="">
+ if ( wp_image_editor_supports( array( 'mime_type' => get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { + $note_no_rotate = ''; + ?> + + ' . __( 'Image rotation is not supported by your web host.' ) . '

'; ?> -
-
+ + -
, this)" class="imgedit-flipv" title="">
-
, this)" class="imgedit-fliph" title="">
+ + -
, this)" class="imgedit-undo disabled" title="">
-
, this)" class="imgedit-redo disabled" title="">
-
+ + +
@@ -184,11 +213,11 @@ function wp_image_editor($post_id, $msg = false) {
- +
- + )" disabled="disabled" class="button button-primary imgedit-submit-btn" value="" />
@@ -208,7 +237,7 @@ function wp_image_editor($post_id, $msg = false) { * @param WP_Image_Editor $image * @param string $mime_type * @param int $post_id - * @return boolean + * @return bool */ function wp_stream_image( $image, $mime_type, $post_id ) { if ( $image instanceof WP_Image_Editor ) { @@ -264,7 +293,7 @@ function wp_stream_image( $image, $mime_type, $post_id ) { * @param WP_Image_Editor $image * @param string $mime_type * @param int $post_id - * @return boolean + * @return bool */ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) { if ( $image instanceof WP_Image_Editor ) { @@ -552,7 +581,7 @@ function image_edit_apply_changes( $image, $changes ) { * in $_REQUEST['history'] * * @param int $post_id - * @return boolean + * @return bool */ function stream_preview_image( $post_id ) { $post = get_post( $post_id ); @@ -562,8 +591,9 @@ function stream_preview_image( $post_id ) { $img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) ); - if ( is_wp_error( $img ) ) - return false; + if ( is_wp_error( $img ) ) { + return false; + } $changes = !empty($_REQUEST['history']) ? json_decode( wp_unslash($_REQUEST['history']) ) : null; if ( $changes ) @@ -614,7 +644,7 @@ function wp_restore_image($post_id) { if ( $parts['basename'] != $data['file'] ) { if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) { - // Delete only if it's edited image. + // Delete only if it's an edited image. if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) { wp_delete_file( $file ); } @@ -637,7 +667,7 @@ function wp_restore_image($post_id) { if ( isset($meta['sizes'][$default_size]) && $meta['sizes'][$default_size]['file'] != $data['file'] ) { if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) { - // Delete only if it's edited image + // Delete only if it's an edited image. if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) { $delete_file = path_join( $parts['dirname'], $meta['sizes'][$default_size]['file'] ); wp_delete_file( $delete_file ); @@ -672,6 +702,8 @@ function wp_restore_image($post_id) { * Saves image to post along with enqueued changes * in $_REQUEST['history'] * + * @global array $_wp_additional_image_sizes + * * @param int $post_id * @return \stdClass */