如何修改WordPress中已上传文件的文件名后缀? [英] How can I modify the filename suffixes of uploaded files in WordPress?
问题描述
我想知道是否可以修改WordPress处理图片上传的方式.如果我现在上传图像,则各种尺寸的默认文件名包括尺寸,如下所示:
image-100x100.jpg
,image-300x300.jpg
,image-600x600.jpg
和image.jpg
.
I was wondering if it is possible to modify the way WordPress handles image uploads. If I upload an image now, the default filenames for the various sizes include the dimensions, something like the following:
image-100x100.jpg
, image-300x300.jpg
, image-600x600.jpg
, and image.jpg
.
虽然在某些情况下这很有用,但我需要这些文件名更具通用性,如下所示:
image-thumb.jpg
,image-medium.jpg
,image-large.jpg
和image.jpg
.
While this may be useful in some cases, I need these file names to be a bit more versatile, something like the following:
image-thumb.jpg
, image-medium.jpg
, image-large.jpg
, and image.jpg
.
有人对我如何实现这一目标有任何想法吗?感谢您的阅读.与往常一样,任何想法或建议都值得赞赏.
Does anyone have any ideas how I could accomplish this? Thank you for reading. As always, any ideas or suggestions are appreciated.
推荐答案
您也许可以使用Wordpress的本机发布图片,您可以使用 add_image_size
为其定义调整尺寸.我认为这是3.0+的功能.
You may be able to use Wordpress' native post images, for which you can define resize dimensions using add_image_size
. I think this is a 3.0+ feature.
这篇关于如何修改WordPress中已上传文件的文件名后缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!