diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 85996d2676..09fa49cb94 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2604,10 +2604,11 @@ function wp_ajax_image_editor() { include_once ABSPATH . 'wp-admin/includes/image-edit.php'; $msg = false; + switch ( $_POST['do'] ) { case 'save': $msg = wp_save_image( $attachment_id ); - if ( $msg->error ) { + if ( ! empty( $msg->error ) ) { wp_send_json_error( $msg ); } @@ -2625,7 +2626,7 @@ function wp_ajax_image_editor() { wp_image_editor( $attachment_id, $msg ); $html = ob_get_clean(); - if ( $msg->error ) { + if ( ! empty( $msg->error ) ) { wp_send_json_error( array( 'message' => $msg, diff --git a/wp-includes/version.php b/wp-includes/version.php index 73a595f6a7..8a718a68b8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5.2-alpha-48955'; +$wp_version = '5.5.2-alpha-48956'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.