fix missing delete backup images

pull/46/head
sy-records 2024-11-21 13:19:09 +08:00
parent 9a5756ba4e
commit 2bee1e5d04
No known key found for this signature in database
GPG Key ID: C3BB4FF13CD72ACE
3 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,7 @@
- [x] 支持原图保护 - [x] 支持原图保护
- [x] 支持 `wp-cli` 命令上传/删除文件 - [x] 支持 `wp-cli` 命令上传/删除文件
- [x] 支持多站点 - [x] 支持多站点
- [x] 支持图片裁剪编辑等操作后的上传
## 安装 ## 安装

View File

@ -400,6 +400,13 @@ function oss_delete_remote_attachment($post_id)
} }
} }
$backup_sizes = get_post_meta($post_id, '_wp_attachment_backup_sizes', true);
if (is_array($backup_sizes)) {
foreach ($backup_sizes as $size) {
$deleteObjects[] = $dirname . $size['file'];
}
}
oss_delete_oss_files($deleteObjects); oss_delete_oss_files($deleteObjects);
} else { } else {
// 获取链接删除 // 获取链接删除

View File

@ -31,7 +31,8 @@ License URI: http://www.apache.org/licenses/LICENSE-2.0.html
10. 支持原图保护 10. 支持原图保护
11. 支持 `wp-cli` 命令上传/删除文件 11. 支持 `wp-cli` 命令上传/删除文件
12. 支持多站点 12. 支持多站点
13. 插件更多详细介绍和安装:[https://github.com/sy-records/aliyun-oss-wordpress](https://github.com/sy-records/aliyun-oss-wordpress) 13. 支持图片裁剪编辑等操作后的上传
14. 插件更多详细介绍和安装:[https://github.com/sy-records/aliyun-oss-wordpress](https://github.com/sy-records/aliyun-oss-wordpress)
## 其他插件 ## 其他插件