wp_restore_image example

$msg = wp_save_image( $attachment_id );
            if ( ! empty( $msg->error ) ) {
                wp_send_json_error( $msg );
            }

            wp_send_json_success( $msg );
            break;
        case 'scale':
            $msg = wp_save_image( $attachment_id );
            break;
        case 'restore':
            $msg = wp_restore_image( $attachment_id );
            break;
    }

    ob_start();
    wp_image_editor( $attachment_id$msg );
    $html = ob_get_clean();

    if ( ! empty( $msg->error ) ) {
        wp_send_json_error(
            array(
                'message' => $msg,
                
Home | Imprint | This part of the site doesn't use cookies.