I'm just getting into WordPress and keep seeing sample code with balanceTags() used when echoing out a variable.
Am I right in thinking it does nothing in terms of output validation?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Right, so it will simply do its best to close any unclosed tag - that's it. Nothing more.
As you can see if you look at the source code, all the function does is make sure to balance out the tags that might not be. It's also explained in the codex. ("force_balance_tags" is the real function that does the work; "balanceTags" defers to it if the options or attributes ask it to)
Hope this helps!