wp_get_original_image_path
云策文档标注
概述
wp_get_original_image_path 是一个 WordPress 过滤器,用于修改原始图像文件的路径。它允许开发者在获取附件原始图像路径时进行自定义处理。
关键要点
- 过滤器名称:wp_get_original_image_path
- 参数:$original_image(原始图像文件路径字符串)和 $attachment_id(附件 ID 整数)
- 用途:在 wp_get_original_image_path() 函数中应用,用于检索上传图像文件的路径
- 引入版本:WordPress 5.3.0
原文内容
Filters the path to the original image.
Parameters
$original_imagestring-
Path to original image file.
$attachment_idint-
Attachment ID.
Source
return apply_filters( 'wp_get_original_image_path', $original_image, $attachment_id );
Changelog
| Version | Description |
|---|---|
| 5.3.0 | Introduced. |