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.