1
This commit is contained in:
@@ -826,15 +826,9 @@ class WordpressSiteService
|
|||||||
$pathInfo = pathinfo(parse_url($imageUrl, PHP_URL_PATH));
|
$pathInfo = pathinfo(parse_url($imageUrl, PHP_URL_PATH));
|
||||||
$extension = strtolower($pathInfo['extension'] ?? 'jpg');
|
$extension = strtolower($pathInfo['extension'] ?? 'jpg');
|
||||||
|
|
||||||
// 确定文件名和 Content-Type(使用原始格式)
|
// 确定文件名和 Content-Type(使用原始格式,不做webp转换)
|
||||||
$filename = ($pathInfo['filename'] ?? 'image') . '.' . $extension;
|
$filename = ($pathInfo['filename'] ?? 'image') . '.' . $extension;
|
||||||
$contentType = 'image/' . ($extension === 'jpg' ? 'jpeg' : $extension);
|
$contentType = 'image/' . ($extension === 'jpg' ? 'jpeg' : $extension);
|
||||||
$filename = ($pathInfo['filename'] ?? 'image') . '.webp';
|
|
||||||
$contentType = 'image/webp';
|
|
||||||
} else {
|
|
||||||
$filename = ($pathInfo['filename'] ?? 'image') . '.' . $extension;
|
|
||||||
$contentType = 'image/' . ($extension === 'jpg' ? 'jpeg' : $extension);
|
|
||||||
}
|
|
||||||
|
|
||||||
$mediaUrl = $domain . '/wp-json/wp/v2/media';
|
$mediaUrl = $domain . '/wp-json/wp/v2/media';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user