WP BianHuan is a WordPress plugin for modifying the rendered HTML on the fly. It parses the post in a DOM and walk through it. In the meantime it provides its own plugin system for others to easily write XML/XHTML transforming magics. Now BianHuan includes these built-in features:
- Unlimited Link Indication: You can setup different CSS class for each kind of Links in your post, so an icon can be displayed besides it to represent what nature the link is, be it external http or email or ftp. You can even configure your owns, such as external links to Wikipedia. (Yes, the icons besides links in this page is added by this plugin). It can also add target="_blank" automatically if no target attribute was set for external links. (Replacement of Link Indication)
- Convert words into links: this is implemented in a plugin for BianHuan, and this feature is fully customizable. What’s more, as BianHuan uses DOM tree walking, it is smart enough not to convert a link already in a link or in a PRE tag or in some attributes. (This feature can replace the SH-Autolink plugin)
- This project based on WordPress AutoLink plugin by Rudd-o, so it does another magic: "it lets you insert hyperlinks, content and images in your posts and pages with easy-to-type shortcut URLs, which don’t become invalid when you change your WordPress content directory or the permalink structure of your site". In addition, it converts these kind of links automatically if you do not use the simplified format, and save them in database.
Compared to the original WordPress AutoLink plugin, BianHuan runs on PHP >= 4.4.0, and it does not require any special php extensions to work. It is based on ezxml library from eZ System.
Another improvement is that BianHuan makes use of WordPress filters/actions system to handle events and provides other plugins hooks to add more functionalities.
Hope you enjoy it: please grab it here.
Why should I choose it?
If you like me, searching for a plugin to do all the transformations like link indication/auto link/save the link in a safe way, definitely leads you to frustration: no such extensible while power plugin exists for WordPress 2.0. WordPress AutoLink plugin is close enough, however it only runs on PHP > 5 and does not provide a easy interface for plugins. Thus I decided to start this project.
In short, if you want a plugin to incorporate all these stuffs, then BianHuan is for you
Installation
Installation is simple and standard, just uncompress the zip file under your wp-content/plugins dir, and go to your Admin interface to activate this plugin. By default, after activation, the plugin still does not function, you have to explicitly tell it to do so by going to its options page and check the first box in that page.
There are bunch other options you may want to customize. This plugin is used here, and you can see source files to get some inspiration.