
內容簡介
這個外掛可以在您上傳至媒體庫時自動將檔名中的語言重音符號轉換。轉換後的字符將會變成網頁和伺服器友好、無語言重音的字元。
功能
將瑞典語、丹麥語、德語等語言的重音字符轉換為無重音、拉丁字母等效字元。
去除感嘆號、句號、井號等特殊字元。
您可以選擇僅轉換圖片檔案或全部檔案類型。
將檔案名稱轉換成無語言重音的字元,使網站和伺服器遷移更加容易。
為想指定要轉換的檔案類型的開發人員提供篩選器勾子。
範例
Räksmörgås.jpg → raksmorgas.jpg
Æblegrød_FTW!.gif → aeblegrod-ftw.gif
Château de Ferrières.png → chateau-de-ferrieres.png
需注意之處
此外掛僅在上傳檔案時轉換檔案名稱,無法轉換現有檔案。
開發人員的篩選器勾子
此篩選器提供開發人員一種方式,以指定外掛應該轉換哪些檔案類型。此篩選器覆蓋媒體設定頁面上的外掛設定。有關 MimeType 的完整列表,請參閱 Wikipedia。
以下示例僅轉換 PDF、JPEG 和 PNG 檔案:
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' );
外掛標籤
開發者團隊
原文外掛簡介
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.
Features
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' );
