Get it All

I’ve been meaning to incorporate the force_balance_tags() function into a few plugins that I’ve created which sample text from posts, but haven’t gotten to it yet. Well, today’s the day, and I’m going to experiment by writing some stuff in italics to see if it screws up my formatting on the page that uses the plugin.

The balance tags function is supposed to check a string of text for all the HTML tags used in that string to determine if there are unclosed tags. We shall see if this works or not. I have to write enough text that the closing tag is past the sample point, which in this case is eighty characters. If it works, everything on the page should look fine. If it does not, everything below my widget should be in italics. We shall see. . . .

You can clearly see that the formatting of this post was just silly and useless from a normal reading perspective.  But what has been proven here is that using the force_balance_tags() function will balance any and all tags and prevent a plugin from ruining your formatting by leaving tags open.  This is a very highly useful function that I plan to implement much, much more often in the future.

Updated to Version 3.0! New Support Page

Titles to Tags is now fully-functional with WordPress 3.0!

I’ve finally found time to wrap by brain around how Tortoise SVN works – which means understanding SVN in the first place, then figuring out how Tortoise’s GUI works – and I’ve updated the plugin after many moons of inactivity. Updates include some revamping of the code based on my experiments with it in another plugin, improved documentation in the plugin itself and bug fixes including the phantom tags commenters have reported.

Download Plugin

Never forget to post your tags again! With the Titles to Tags plugin, WordPress will scan your post’s title for the most keyword-appropriate words and add them to your tags list automatically on save! The plugin comes with a very long list of words which are statistically irrelevant, such as “I” or “among,” which don’t make good keywords. You can also edit this list to include more or less terms by going to Options > Titles 2 Tags. There is also an option to revert to the original list, but watch out! You will lose your edited list forever if you do this!

This plugin will only save tags to your posts if none exist already. The presumption is that if you’ve already saved tags, you must know what you want and anyway, you might have removed some tags Titles to Tags added because you don’t like them. The function runs every time you save a post, either by publishing, saving or editing the post.

To install the plugin, simply download it from the WordPress Plugin Repository, then extract both the hn_titles_to_tags.php file and then hn_t2t and it’s contents into your /plugins folder. Activate the plugin by going to Plugins, and begin posting as normal.

WordPress MU Developers: Note that, if your creating a community-based website built on MU – and your users aren’t being diligent about adding tags – this is a great way to get those tags created painlessly! You can place the file and it’s companion directory in the /mu-plugins file and each blog will get it’s own editable list of ignored words.

And hey! If you like this plugin, I would really appreciate it if you went back to the page and rated it! Thanks!