2

In wordpress there is a function of some sort that will strip html tags but allow certain tags and certain attributes. I was able to find how to change the allowed tags and attributes but no luck trying to find the actual "strip_tags" function that i could use elsewhere in my theme that abides by the set parameters. It would be extremely useful to know this function name.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Emery King
  • 3,550
  • 23
  • 34

1 Answers1

3

You mean wp_kses?

Hobo
  • 7,536
  • 5
  • 40
  • 50
  • Nice find! i think that's it. – Emery King Dec 21 '11 at 13:55
  • 2
    right, wordpress uses this function to make sure the comments are safe.. the build in strip_tags function won't do the trick for several reason like the fact that if you allow some tags you can't block the attributes.. more info on why strip_tags is not used for this you can find here http://www.reddit.com/r/PHP/comments/nj5t0/what_everyone_should_know_about_strip_tags/ – mishu Dec 21 '11 at 13:59