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.
Asked
Active
Viewed 132 times
2
-
`strip_tags` is a PHP function. – Daniel A. White Dec 21 '11 at 13:44
-
You mean a function that isn't [`strip_tags`](http://php.net/manual/en/function.strip-tags.php)? – lonesomeday Dec 21 '11 at 13:44
-
yes. If you look at wordpress comments, the default form shows allowed tags - which works with strip_tags but also it has allowed attributes. – Emery King Dec 21 '11 at 13:46
-
possible duplicate of [php: how can I remove attributes from an html tag?](http://stackoverflow.com/questions/770219/php-how-can-i-remove-attributes-from-an-html-tag) – Daniel A. White Dec 21 '11 at 13:47
-
Probably get better traction on http://wordpress.stackexchange.com/ – Dancrumb Dec 21 '11 at 13:54
1 Answers
3
-
-
2right, 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