Title: Cleanup Text
Author: roggie
Published: <strong>2010 年 5 月 8 日</strong>
Last modified: 2010 年 8 月 12 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/cleanup-text.svg)

# Cleanup Text

 作者：[roggie](https://profiles.wordpress.org/roggie/)

[下载](https://downloads.wordpress.org/plugin/cleanup-text.zip)

 * [详情](https://cn.wordpress.org/plugins/cleanup-text/#description)
 * [评价](https://cn.wordpress.org/plugins/cleanup-text/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/cleanup-text/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/cleanup-text/#developers)

 [支持](https://wordpress.org/support/plugin/cleanup-text/)

## 描述

WordPress posts and pages can contain Smart quotes and other fancy characters. But
Smartquotes and other special characters don’t work properly if you send the contents
of a post by email. 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. If you use 
a filter to remove Smart quotes you can’t also use strip_tags to remove HTML.

Also, WordPress filters don’t remove all the characters that could cause problems.
For example, double spaces are not removed properly by WordPress, and Europeans 
will have problems with the UK pound currency symbol.

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

It also has an option to remove HTML.

## 安装

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

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

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

E.g. replace “the_content()” with “cleanup_text( the_content() )”

## 常见问题

**How do I use the plugin?**
 Call the function cleanup_text() from within your 
theme or other plugin. Supply the text to be cleaned as the first argument. E.g.`
<?php $clean_text = cleanup_text( $text_to_clean ) ; ?>`

**How do I get the plugin to remove HTML?**
 Call the function with TRUE as the 
second argument. E.g. `<?php $clean_text = cleanup_text( $text_to_clean, TRUE) ;?
>`

**Can I use cleanup_text for web pages?**
 Yes, you could use cleanup_text to clean
text that will be displayed on a web page. You would probably use something like:
E.g. `<?php echo cleanup_text( get_the_content() ) ; ?>`

But the results will probably not be what you want because cleanup_text uses “\n”
for new lines, and web pages use `<br />` or some other HTML notation.

If you really want to do this let me know and I’ll update the plugin so it can be
used in this way.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Cleanup Text」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ roggie ](https://profiles.wordpress.org/roggie/)

[帮助将「Cleanup Text」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/cleanup-text)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/cleanup-text/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/cleanup-text/)，或通过[RSS](https://plugins.trac.wordpress.org/log/cleanup-text/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/cleanup-text/)。

## 更新日志

For changelog please visit http://www.thehypervisor.com/cleanup-text/

## 额外信息

 *  版本 **2.0.1**
 *  最后更新：**16 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 1.0.0 或更高版本 **
 *  已测试的最高版本为 **3.0.0**
 *  语言
 * [English (US)](https://wordpress.org/plugins/cleanup-text/)
 * 标签
 * [filter](https://cn.wordpress.org/plugins/tags/filter/)[html](https://cn.wordpress.org/plugins/tags/html/)
   [Smart Quotes](https://cn.wordpress.org/plugins/tags/smart-quotes/)[special characters](https://cn.wordpress.org/plugins/tags/special-characters/)
 *  [高级视图](https://cn.wordpress.org/plugins/cleanup-text/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/cleanup-text/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/cleanup-text/reviews/)

## 贡献者

 *   [ roggie ](https://profiles.wordpress.org/roggie/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/cleanup-text/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://www.rogerh.com/donate.html)