Clean Image Filenames WordPress 插件

Clean Image Filenames WordPress 插件

描述

This plugin automatically converts language accent characters in filenames when uploading to the media library. Characters are converted into browser and server friendly, non-accent characters.

产品特点

  • Converts accent characters to non-accent, latin equivalents in Swedish, Danish, German, and more.
  • Removes special characters like exclamation marks, periods, hashtags, and more.
  • Lets you choose if you want to convert only image files, or all file types.
  • Makes site and server migrations easier thanks to non-accent character filenames.
  • Provides filter hook for developers who want to specify which file types to convert.

Examples

  • Räksmörgås.jpg → raksmorgas.jpg
  • Æblegrød_FTW!.gif → aeblegrod-ftw.gif
  • Château de Ferrières.png → chateau-de-ferrieres.png

Worth noting

The plugin only converts filenames when the files are being uploaded. It can not convert existing files.

Filter for developers

This filter provides developers a way to specify which file types the plugin should convert. This filter overrides the plugin settings on the media settings page. For a complete list of mime types, see Wikipedia.

The following example will convert PDF, JPEG and PNG files only:

function my_clean_image_filenames_mime_types() {    $mime_types = array(        'application/pdf',        'image/jpeg',        'image/png',    );    return $mime_types;}add_filter( 'clean_image_filenames_mime_types', 'my_clean_image_filenames_mime_types' );

相关推荐

发表评论

房先生
我们将24小时内回复。
2023-12-14 23:59:58
您好,有任何疑问请与我们联系!
您的工单我们已经收到,我们将会尽快跟您联系!
[加我微信]
chaoneo
注:点击复制微信号并打开微信APP,添加好友后进行聊天。
[电话联系]
13585372227
[电子邮件]
[email protected]
取消

选择聊天工具: