[wordpress插件] Cleanup Text清理文字

wordpress 插件 文章 2020-03-24 15:10 454 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

WordPress posts and pages can contain Smart quotes and other fancy characters.

WordPress帖子和页面可以包含智能引号和其他花哨字符。

But Smartquotes and other special characters don’t work properly if you send the contents of a post by email.

但是,如果您通过电子邮件发送帖子内容,则Smartquotes和其他特殊字符将无法正常工作。

This plugin cleans up text so it can be emailed properly.

该插件可以清理文本,以便可以通过电子邮件将其正确发送。

Instead of using this plugin you could use WordPress filters to reformat text, but WordPress filters cannot be used with PHP functions like strip_tags.

您可以使用WordPress过滤器来重新格式化文本,而不是使用此插件,但是WordPress过滤器不能与strip_tags等PHP函数一起使用。

If you use a filter to remove Smart quotes you can’t also use strip_tags to remove HTML.

如果您使用过滤器删除智能引号,则也不能使用strip_tags删除HTML。

Also, WordPress filters don’t remove all the characters that could cause problems.

此外,WordPress过滤器不会删除所有可能引起问题的字符。

For example, double spaces are not removed properly by WordPress, and Europeans will have problems with the UK pound currency symbol.

例如,WordPress无法正确删除双精度空格,欧洲人会遇到英镑货币符号的问题。

This very simple plugin removes all sorts of special characters, including double spaces and currency symbols that WordPress filters don’t manage.

这个非常简单的插件可删除各种特殊字符,包括WordPress过滤器无法管理的双精度空格和货币符号。

It also has an option to remove HTML.

它还具有删除HTML的选项。

安装步骤

1) Copy the file cleanup_text.php to your WordPress plugins directory.

1)将文件cleanup_text.php复制到您的WordPress插件目录。

2) Login to WordPress as an administrator, go to Plugins and Activate it.

2)以管理员身份登录WordPress,转到“插件”并将其激活。

3) Call the plugin anywhere in your theme or other PHP code.

3)在主题或其他PHP代码中的任意位置调用插件。

E.g.

例如

replace “the_content()” with “cleanup_text( the_content() )”

将“ the_content()”替换为“ cleanup_text(the_content())”

下载地址
https://downloads.wordpress.org/plugin/cleanup-text.zip
-EOF-

AI助手支持GPT4.0