Implementation process – Eternal Night https://www.shuijingwanwq.com There is no problem not worth solving, and no technology not worth learning! Sun, 17 May 2026 06:05:00 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 The implementation process of adding and editing a picture management https://www.shuijingwanwq.com/en/2025/07/23/11294/ https://www.shuijingwanwq.com/en/2025/07/23/11294/#respond Wed, 23 Jul 2025 01:14:55 +0000 https://www.shuijingwanwq.com/?p=11294 浏览量: 31

1. Now in the addition|editing page of an article, the cover image of the article is realized by uploading the image by calling the interface image/upload. ID Write to the cover_image_id of the article table. as shown in Figure 1

现在在一个文章的添加|编辑页面中,文章的封面图是通过调用接口 image/upload 上传图片实现的,接口响应回图片的 images 表中的 ID,然后提交表单时,将 images 表中的 ID 写入至文章表的 cover_image_id

Figure 1

2. Now it is planned to implement a picture management, and I also hope that the image/upload interface can be reused to realize image upload. However, when adding and editing pictures, when submitting the form, it should no longer be involved in the increase of records in the images table. Refer to WordPress’s media management, add a picture into two steps, the first step is to upload a picture, and the second step is to edit the picture information. as shown in Figure 2

现在计划实现一个图片管理,也希望能够复用 image/upload 接口实现图片上传。但是,图片的添加与编辑,在提交表单时,不应该再涉及到 images 表中的记录的再次增加。参考 WordPress 的 媒体管理 ,添加一张图片分为 2 个步骤,第一步是上传一张图片,第二步是编辑图片信息。

Figure 2

3. The final implementation process is: when adding a form page, only upload pictures are allowed. After the upload is successful, it will automatically jump to the picture editing page. as shown in Figure 3

最终实现流程为:在添加表单页面,只允许上传图片,上传成功后,自动跳转至图片编辑页面

Figure 3

]]>
https://www.shuijingwanwq.com/en/2025/07/23/11294/feed/ 0