fix oss_delete_remote_attachment
parent
47e1012b69
commit
3f32df51d1
|
@ -3,7 +3,7 @@
|
||||||
Plugin Name: OSS Aliyun
|
Plugin Name: OSS Aliyun
|
||||||
Plugin URI: https://github.com/sy-records/aliyun-oss-wordpress
|
Plugin URI: https://github.com/sy-records/aliyun-oss-wordpress
|
||||||
Description: 使用阿里云对象存储 OSS 作为附件存储空间。(This is a plugin that uses Aliyun Object Storage Service for attachments remote saving.)
|
Description: 使用阿里云对象存储 OSS 作为附件存储空间。(This is a plugin that uses Aliyun Object Storage Service for attachments remote saving.)
|
||||||
Version: 1.2.1
|
Version: 1.2.2
|
||||||
Author: 沈唁
|
Author: 沈唁
|
||||||
Author URI: https://qq52o.me
|
Author URI: https://qq52o.me
|
||||||
License: Apache 2.0
|
License: Apache 2.0
|
||||||
|
@ -14,7 +14,7 @@ require_once 'sdk/vendor/autoload.php';
|
||||||
use OSS\OssClient;
|
use OSS\OssClient;
|
||||||
use OSS\Core\OssException;
|
use OSS\Core\OssException;
|
||||||
|
|
||||||
define('OSS_VERSION', '1.2.1');
|
define('OSS_VERSION', '1.2.2');
|
||||||
define('OSS_BASEFOLDER', plugin_basename(dirname(__FILE__)));
|
define('OSS_BASEFOLDER', plugin_basename(dirname(__FILE__)));
|
||||||
|
|
||||||
// 初始化选项
|
// 初始化选项
|
||||||
|
@ -267,9 +267,9 @@ function oss_delete_remote_attachment($post_id) {
|
||||||
|
|
||||||
$deleteObjects[] = str_replace("\\", '/', $file_path);
|
$deleteObjects[] = str_replace("\\", '/', $file_path);
|
||||||
|
|
||||||
$oss_options = get_option('oss_options', true);
|
// $oss_options = get_option('oss_options', true);
|
||||||
$is_nothumb = (esc_attr($oss_options['nothumb']) == 'false');
|
// $is_nothumb = (esc_attr($oss_options['nothumb']) == 'false');
|
||||||
if ($is_nothumb) {
|
// if ($is_nothumb) {
|
||||||
// 删除缩略图
|
// 删除缩略图
|
||||||
if (isset($meta['sizes']) && count($meta['sizes']) > 0) {
|
if (isset($meta['sizes']) && count($meta['sizes']) > 0) {
|
||||||
foreach ($meta['sizes'] as $val) {
|
foreach ($meta['sizes'] as $val) {
|
||||||
|
@ -277,7 +277,7 @@ function oss_delete_remote_attachment($post_id) {
|
||||||
$deleteObjects[] = str_replace("\\", '/', $size_file);
|
$deleteObjects[] = str_replace("\\", '/', $size_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
oss_delete_oss_files($deleteObjects);
|
oss_delete_oss_files($deleteObjects);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue