mawilson
Member
Posted 5 years ago #
Many WP blogs include a list of allowed XHTML tags on their comments form... I know that WP uses kses.php to process the comments (from http://wordpress.org/support/topic/76975); however I can't find details on which function to use to list out the allowed tags to my users.
Please, can anyone offer me some advice?
Mark
http://www.markwilson.co.uk/blog/
in your comments.php look for something like this
<p><strong>Some HTML allowed:</strong><br/><?php echo allowed_tags(); ?></p>
it might be there and edited out, if so remove the editing comments.
if it isnt there, put in the php call with whatever else you want, ive got the p and strong tags.
mawilson
Member
Posted 5 years ago #
Fantastic! That did the trick - thank you. Now, does anyone know how I remove <b> and <i> from the allowed list as they have been deprecated in XHTML 1.1?
edit wp-includes/kses.php
Don't bother removing them. B and I get transformed into strong and em automatically anyway. I think. Try it and see. :)
mawilson
Member
Posted 5 years ago #
@whooami... thanks for that guidance - sorry if that is too obvious but I didn't know if there was a preferred method or anything. Commenting out the <b>, <i> and <strike> tags in $allowed tags worked as I'd hoped.
@Otto42 - thanks also for taking the time to reply; however I have removed the non-compliant tags just in case ;-)
cheberk
Member
Posted 4 years ago #
I just set up a blog for students in my intro to web design class (more of a design class than a programming class). I want them to be able to use the style tag in their posts... Yes, it's going to make for some hideous comments, but that's part of the learning process.
Can you be more specific about how to allow the style tag to the kses.php file?
Thanks!