[wordpress插件] Clean Image Filenames清理映像文件名

wordpress 插件 文章 2020-03-24 10:00 572 0 全屏看文

AI助手支持GPT4.0

评分
94
描述

Filenames with special characters or language accent characters, like Château de Ferrières.jpg and smörgåsbord.png, can sometimes be a problem for browsers or servers.

带有特殊字符或语言重音字符的文件名,例如ChâteaudeFerrières.jpg和smörgåsbord.png,有时对于浏览器或服务器来说是一个问题。

This plugin takes care of that and cleans the filenames of files uploaded to the WordPress media library.

该插件可以解决此问题,并清除上传到WordPress媒体库的文件的文件名。

This plugin cleans the filenames from special characters like exclamation marks, periods, and commas and accent characters like Swedish and German umlauts.

此插件可清除文件名中的特殊字符,例如感叹号,句号和逗号,以及带有重音符号的字符,例如瑞典和德国变音符号。

Special characters are remove, accent characters are converted to their non-accent equivalent, and blank spaces are converted into dashes.

删除特殊字符,将重音符号转换为非重音符号,并将空格转换为破折号。

Easily set the plugin to clean the filenames of images only or all files uploaded to the media library.

轻松设置插件以仅清除图像文件名或所有上传到媒体库的文件的文件名。

Developers can take advantage of the built in filter to get really specific about what file types to clean the filenames of.

开发人员可以利用内置的过滤器来真正确定要清除其文件名的文件类型。

Features

功能

    • Can be used for all file types, not only images
    • 不仅可以用于图像,还可以用于所有文件类型

    • Multisite compatible
    • 兼容多站点

    • Works with custom upload_dir setups
    • 使用自定义的upload_dir设置

    • Doesn’t alter your database or uploads settings
    • 不更改数据库或上传设置

    • Gutenberg ready
    • 古腾堡准备好了

    Plugin filter for developers

    开发人员插件过滤器

    Developers can get really specific about what file types to clean by using the clean_image_filenames_mime_types filter in their plugins or themes.

    开发人员可以通过在其插件或主题中使用 clean_image_filenames_mime_types 过滤器来真正确定要清除哪些文件类型。

    When using this filter, settings saved through the settings page are overridden. For a complete list of mime types, see

    使用此过滤器时,将覆盖通过设置页面保存的设置。有关mime类型的完整列表,请参见

    ="nofollow">Wikipedia.

    =“ nofollow”>维基百科。

    The following example would make the plugin clean the filenames for PDF, JPEG and PNG files only.

    以下示例将使插件仅清除PDF,JPEG和PNG文件的文件名。

    function my_clean_image_filenames_mime_types() {    

      function my_clean_image_filenames_mime_types(){    

    $mime_types = array(        

    $ mime_types =数组(        

    'application/pdf',        

    “应用程序/ pdf”,        

    'image/jpeg',        

    '图像/ JPEG',        

    'image/png',    

    'image / png',    

    );    

    );    

    return $mime_types;

    返回$ mime_types;

    }

    }

    add_filter('clean_image_filenames_mime_types', 'my_clean_image_filenames_mime_types');

    add_filter('clean_image_filenames_mime_types','my_clean_image_filenames_mime_types');

安装步骤

    1. Upload the clean-image-filenames directory to the /wp-content/plugins/ directory.
    2. clean-image-filenames 目录上传到 / wp-content / plugins / 目录。

    3. Activate the plugin through the ‘Plugins’ menu in WordPress.
    4. 通过WordPress中的“插件”菜单激活插件。

下载地址
https://downloads.wordpress.org/plugin/clean-image-filenames.1.2.1.zip
-EOF-

AI助手支持GPT4.0